From 5372ef1e79ab3bc7ce84149cdde004c067323a12 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Mon, 23 Oct 2017 16:52:06 +0200 Subject: [PATCH 01/10] fix for LCGDM-2507 --- templates/override.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/override.erb b/templates/override.erb index 17fc585..3d471bb 100644 --- a/templates/override.erb +++ b/templates/override.erb @@ -1,7 +1,7 @@ [Service] User= <%= @xrootd_user %> Group= <%= @xrootd_group %> - +RuntimeDirectory=xrootd <% if @exports -%> <% @exports.sort.map do |key,val| -%> Environment=<%= key %>=<%= val %> From c692308024b957c05307e2ee2f7d88924af760ed Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Thu, 16 Nov 2017 15:34:00 +0100 Subject: [PATCH 02/10] changes needed by LCGDM-2530 and LCGDM-2529 --- manifests/params.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index 861ae8e..c355d56 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -74,4 +74,6 @@ $oss_localroot = undef $certificate = '/etc/grid-security/hostcert.pem' $key = '/etc/grid-security/hostkey.pem' + $runtime_dir = 'xrootd' + $after_conf = 'network-online.target' } From 6d3fdc22decd842d5d6c6c5d9419244b81accb3b Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Thu, 16 Nov 2017 15:35:42 +0100 Subject: [PATCH 03/10] changes needed by LCGDM-2530 and LCGDM-2529 --- templates/override.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/override.erb b/templates/override.erb index 3d471bb..56d0bba 100644 --- a/templates/override.erb +++ b/templates/override.erb @@ -1,7 +1,9 @@ [Service] -User= <%= @xrootd_user %> -Group= <%= @xrootd_group %> -RuntimeDirectory=xrootd +User=<%= @xrootd_user %> +Group=<%= @xrootd_group %> +RuntimeDirectory=<%= @runtime_dir %> +After=<%= @after_conf %> + <% if @exports -%> <% @exports.sort.map do |key,val| -%> Environment=<%= key %>=<%= val %> From 92758e47e5b13cd2e7ce7292c623f2cd117fa516 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Thu, 16 Nov 2017 15:44:55 +0100 Subject: [PATCH 04/10] changes needed by LCGDM-2530 and LCGDM-2529 --- manifests/config.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 970633b..710b855 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -7,6 +7,8 @@ $logdir = $xrootd::params::logdir, $spooldir = $xrootd::params::spooldir, $all_pidpath = $xrootd::params::all_pidpath, + $runtime_dir = $xrootd::params::runtime_dir, + $after_conf = $xrootd::params::after_conf ) inherits xrootd::params { From df9023f197381c8e859e659d3fc2cc8e16e3c34c Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Thu, 16 Nov 2017 15:53:43 +0100 Subject: [PATCH 05/10] changes needed by LCGDM-2530 and LCGDM-2529 --- manifests/create_systemd.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/create_systemd.pp b/manifests/create_systemd.pp index ce1afc6..5ad9ba8 100644 --- a/manifests/create_systemd.pp +++ b/manifests/create_systemd.pp @@ -3,7 +3,9 @@ $xrootd_user = $xrootd::config::xrootd_user, $xrootd_group = $xrootd::config::xrootd_group, $exports = $xrootd::config::exports, - $daemon_corefile_limit = $xrootd::config::daemon_corefile_limit + $daemon_corefile_limit = $xrootd::config::daemon_corefile_limit, + $runtime_dir = $xrootd::config::runtime_dir, + $after_conf = $xrootd::config::after_conf ) { include xrootd::config From 3f452693616dbbc1c92e9c8746d8a6cbe16264f4 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Thu, 16 Nov 2017 18:06:44 +0100 Subject: [PATCH 06/10] fix location of After directive --- templates/override.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/override.erb b/templates/override.erb index 56d0bba..c42923f 100644 --- a/templates/override.erb +++ b/templates/override.erb @@ -1,8 +1,10 @@ +[Unit] +After=<%= @after_conf %> + [Service] User=<%= @xrootd_user %> Group=<%= @xrootd_group %> RuntimeDirectory=<%= @runtime_dir %> -After=<%= @after_conf %> <% if @exports -%> <% @exports.sort.map do |key,val| -%> From eef613bfa1688449117e247d6887a5c7b6df4016 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Tue, 21 Nov 2017 11:15:16 +0100 Subject: [PATCH 07/10] update travis conf --- .gitignore | 21 ++++++++++++++ .travis.yml | 44 ++++++++++------------------ Gemfile | 84 +++++++++++++++++++++++++++++++++++++++++++---------- Rakefile | 76 +++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 166 insertions(+), 59 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a37077 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +pkg/ +Gemfile.lock +Gemfile.local +vendor/ +.vendor/ +spec/fixtures/manifests/ +spec/fixtures/modules/ +.vagrant/ +.bundle/ +.ruby-version +coverage/ +log/ +.idea/ +.dependencies/ +.librarian/ +Puppetfile.lock +*.iml +.*.sw? +.yardoc/ +Guardfile + diff --git a/.travis.yml b/.travis.yml index c863649..8192a37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,17 @@ ---- +sudo: false +dist: trusty language: ruby -bundler_args: --without development -script: "bundle exec rake validate && bundle exec rake spec SPEC_OPTS='--format documentation'" +cache: bundler +before_install: +- bundle -v +- rm Gemfile.lock || true +- gem update --system +- gem update bundler +- gem --version +- bundle -v +script: +- bundle exec rake $CHECK matrix: - fast_finish: true - include: - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 4.0" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 4.0" - - rvm: 2.1.5 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 2.1.5 - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" - - rvm: 2.1.5 - env: PUPPET_GEM_VERSION="~> 4.0" -notifications: - email: false +- rvm: 2.4.2 + bundler_args: --without system_tests development release + env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes diff --git a/Gemfile b/Gemfile index bbec3fe..666c75d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,25 +1,77 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" -# https://github.com/rspec/rspec-core/issues/1864 -gem 'rspec', '~> 3.1.0' -gem 'puppetlabs_spec_helper', '>= 0.1.0' -gem 'puppet-lint', '>= 0.3.2' - -if RUBY_VERSION != '1.8.7' - gem 'beaker-rspec', :require => false - gem 'pry', :require => false +def location_for(place, fake_version = nil) + if place =~ /^(git[:@][^#]*)#(.*)/ + [fake_version, { :git => $1, :branch => $2, :require => false }].compact + elsif place =~ /^file:\/\/(.*)/ + ['>= 0', { :path => File.expand_path($1), :require => false }] + else + [place, { :require => false }] + end end -if facterversion = ENV['FACTER_GEM_VERSION'] - gem 'facter', facterversion, :require => false -else - gem 'facter', :require => false +group :test do + gem 'puppetlabs_spec_helper', '~> 2.5.0', :require => false + gem 'rspec-puppet', '~> 2.5', :require => false + gem 'rspec-puppet-facts', :require => false + gem 'rspec-puppet-utils', :require => false + gem 'puppet-lint-leading_zero-check', :require => false + gem 'puppet-lint-trailing_comma-check', :require => false + gem 'puppet-lint-version_comparison-check', :require => false + gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false + gem 'puppet-lint-unquoted_string-check', :require => false + gem 'puppet-lint-variable_contains_upcase', :require => false + gem 'metadata-json-lint', :require => false + gem 'redcarpet', :require => false + gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0' + gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0' + gem 'mocha', '>= 1.2.1', :require => false + gem 'coveralls', :require => false + gem 'simplecov-console', :require => false + gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2' + gem 'parallel_tests', :require => false +end + +group :development do + gem 'travis', :require => false + gem 'travis-lint', :require => false + gem 'guard-rake', :require => false + gem 'overcommit', '>= 0.39.1', :require => false +end + +group :system_tests do + gem 'winrm', :require => false + if beaker_version = ENV['BEAKER_VERSION'] + gem 'beaker', *location_for(beaker_version) + else + gem 'beaker', '>= 3.9.0', :require => false + end + if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION'] + gem 'beaker-rspec', *location_for(beaker_rspec_version) + else + gem 'beaker-rspec', :require => false + end + gem 'serverspec', :require => false + gem 'beaker-puppet_install_helper', :require => false + gem 'beaker-module_install_helper', :require => false end -if puppetversion = ENV['PUPPET_GEM_VERSION'] - gem 'puppet', puppetversion, :require => false +group :release do + gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2' + gem 'puppet-blacksmith', :require => false + gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem' + gem 'puppet-strings', '~> 1.0', :require => false +end + + + +if facterversion = ENV['FACTER_GEM_VERSION'] + gem 'facter', facterversion.to_s, :require => false, :groups => [:test] else - gem 'puppet', :require => false + gem 'facter', :require => false, :groups => [:test] end -# vim:ft=ruby +ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s +gem 'puppet', puppetversion, :require => false, :groups => [:test] + +# vim: syntax=ruby diff --git a/Rakefile b/Rakefile index d1e11f7..041d233 100644 --- a/Rakefile +++ b/Rakefile @@ -1,18 +1,66 @@ -require 'rubygems' require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' -PuppetLint.configuration.send('disable_80chars') -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] - -desc "Validate manifests, templates, and ruby files" -task :validate do - Dir['manifests/**/*.pp'].each do |manifest| - sh "puppet parser validate --noop #{manifest}" - end - Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| - sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ + +# load optional tasks for releases +# only available if gem group releases is installed +begin + require 'puppet_blacksmith/rake_tasks' + require 'voxpupuli/release/rake_tasks' + require 'puppet-strings/tasks' +rescue LoadError +end + +PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}' +PuppetLint.configuration.fail_on_warnings = true +PuppetLint.configuration.send('relative') +PuppetLint.configuration.send('disable_140chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') + +exclude_paths = %w( + pkg/**/* + vendor/**/* + .vendor/**/* + spec/**/* +) +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +desc 'Run acceptance tests' +RSpec::Core::RakeTask.new(:acceptance) do |t| + t.pattern = 'spec/acceptance' +end + +desc 'Run tests metadata_lint, release_checks' +task test: [ + :metadata_lint, + :release_checks, +] + +desc "Run main 'test' task and report merged results to coveralls" +task test_with_coveralls: [:test] do + if Dir.exist?(File.expand_path('../lib', __FILE__)) + require 'coveralls/rake/task' + Coveralls::RakeTask.new + Rake::Task['coveralls:push'].invoke + else + puts 'Skipping reporting to coveralls. Module has no lib dir' end - Dir['templates/**/*.erb'].each do |template| - sh "erb -P -x -T '-' #{template} | ruby -c" +end + +begin + require 'github_changelog_generator/task' + GitHubChangelogGenerator::RakeTask.new :changelog do |config| + version = (Blacksmith::Modulefile.new).version + config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/ + config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." + config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} + config.user = 'voxpupuli' + metadata_json = File.join(File.dirname(__FILE__), 'metadata.json') + metadata = JSON.load(File.read(metadata_json)) + config.project = metadata['name'] end +rescue LoadError end +# vim: syntax=ruby + From 9fdfbf98426f8a2b11886cb9540b4cf03607a880 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Wed, 10 Jan 2018 10:07:07 +0100 Subject: [PATCH 08/10] rename systemctl-daemon-reload to systemctl-daemon-reload-xrootd --- manifests/config.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 710b855..d1697f2 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -21,7 +21,7 @@ } exec { - 'systemctl-daemon-reload': + 'systemctl-daemon-reload-xrootd': command => '/usr/bin/systemctl daemon-reload', refreshonly => true, } From a7f109975b0ea611e7f57b3ceae1343738909346 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Fri, 23 Mar 2018 11:15:26 +0100 Subject: [PATCH 09/10] update version --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 1cc09d8..5e94a0e 100644 --- a/metadata.json +++ b/metadata.json @@ -19,5 +19,5 @@ "source": "https://github.com/cern-it-sdc-id/puppet-xrootd", "summary": "This module installs and configure a xrootd server", "tags": [], - "version": "0.2.4" + "version": "0.2.6" } From bd81afa610a18c2b0156310a69a9a0c41ec1c1e5 Mon Sep 17 00:00:00 2001 From: andrea-manzi Date: Tue, 5 Jun 2018 11:58:49 +0200 Subject: [PATCH 10/10] update CHANGELOG --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3b345af..2a7e933 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2018-06-04 Andrea Manzi + * more fixes for C7 2017-08-17 Andrea Manzi * fix dependency cycle on C7 2016-08-23 Andrea Manzi