diff --git a/.gitattributes b/.gitattributes index 543dd6adb37360d18fb7d0ae8874f41f5d9ecf0f..9032a014a054849db4e22f22b6536cf92c7edd27 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ *.erb eol=lf *.pp eol=lf *.sh eol=lf +*.epp eol=lf diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b673c2b8f13087a352611c1f4833bc787f279e08..985239e33577331a57d2fb51a2d250af131a5c3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,15 +17,6 @@ before_script: - bundle -v - bundle install --without system_tests --path vendor/bundle --jobs $(nproc) -parallel_spec-Ruby 2.1.9-Puppet ~> 4.0: - stage: unit - image: ruby:2.1.9 - script: - - bundle exec rake parallel_spec - variables: - PUPPET_GEM_VERSION: '~> 4.0' - RUBYGEMS_VERSION: '2.7.8' - syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5: stage: syntax image: ruby:2.4.4 @@ -42,51 +33,6 @@ parallel_spec-Ruby 2.4.4-Puppet ~> 5.5: variables: PUPPET_GEM_VERSION: '~> 5.5' -acceptance with puppet4 ubuntu1604: - stage: acceptance - variables: - BEAKER_PUPPET_COLLECTION: 'pc1' - PUPPET_INSTALL_TYPE: 'agent' - BEAKER_IS_PE: 'no' - BEAKER_debug: 'true ' - BEAKER_setfile: 'host.yml' - RBENV_VERSION: '2.4.4' - script: - - beaker-hostgenerator ubuntu1604-64{hypervisor=docker} > host.yml - - bundle exec rake beaker - tags: - - puppet-tests - -acceptance with puppet4 debian8: - stage: acceptance - variables: - BEAKER_PUPPET_COLLECTION: 'pc1' - PUPPET_INSTALL_TYPE: 'agent' - BEAKER_IS_PE: 'no' - BEAKER_debug: 'true ' - BEAKER_setfile: 'host.yml' - RBENV_VERSION: '2.4.4' - script: - - beaker-hostgenerator debian8-64{hypervisor=docker} > host.yml - - bundle exec rake beaker - tags: - - puppet-tests - -acceptance with puppet4 centos7: - stage: acceptance - variables: - BEAKER_PUPPET_COLLECTION: 'pc1' - PUPPET_INSTALL_TYPE: 'agent' - BEAKER_IS_PE: 'no' - BEAKER_debug: 'true ' - BEAKER_setfile: 'host.yml' - RBENV_VERSION: '2.4.4' - script: - - beaker-hostgenerator centos7-64{hypervisor=docker} > host.yml - - bundle exec rake beaker - tags: - - puppet-tests - acceptance with puppet5 ubuntu1604: stage: acceptance variables: diff --git a/README.md b/README.md index 4860848f7ee1995b74eb529638085a129af800ff..2dd25a6f025ebb2dc906309084b81365854aa828 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ This `wordpress` module depends on `puppetlabs-stdlib` and `puppet-archive` ### Beginning with wordpress -The very basic step : +The following very basic step will install WP-CLI tool : ``` class { 'wordpress' : @@ -261,9 +261,9 @@ This module is tested with following OSes : Known bugs are listed in `CHANGELOG.md` file. -This revision is the last one supporting puppet 4.7. -Next one will increase minimal version of puppet to 4.10, at least. -Tests are done with last available release of puppet 4, 5 and 6. +Even if module should work with Puppet4, Puppet 4 is end of life since 2019-01-01. +So tests with Puppet 4 are removed. +Acceptance tests are done with last available release 5 and 6. ## Development diff --git a/Rakefile b/Rakefile index 204fb18cdc93921bd5fd42edf660b53e874f7ef8..a6b14c56414df983a540588e2a4348256a9db186 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,7 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? +require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" diff --git a/metadata.json b/metadata.json index bf6b5afeeeca9da258f0f6bbed0a61a3109128be..d6b917b23573553bb1c7a918177b4041c26b55ce 100644 --- a/metadata.json +++ b/metadata.json @@ -40,10 +40,10 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 4.7.0 < 7.0.0" + "version_requirement": ">= 5.0.0 < 7.0.0" } ], - "pdk-version": "1.7.1", + "pdk-version": "1.8.0", "template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git", - "template-ref": "1.7.1-0-g810b982" -} + "template-ref": "1.8.0-0-g0d9da00" +} \ No newline at end of file diff --git a/spec/default_facts.yml b/spec/default_facts.yml index e10d991db2309d55e9b3ff432aeb50399b90fd67..ea1e4808e3a67f50ea6d64d23a0eb8b3fd25437f 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -2,7 +2,6 @@ # # Facts specified here will override the values provided by rspec-puppet-facts. --- -concat_basedir: "" ipaddress: "172.16.254.254" is_pe: false macaddress: "AA:AA:AA:AA:AA:AA" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5e721b7ff4d57a0388bb30676ba8ccc3cf5dd477..35654b3d2cab1789591caaaa414631fd7ded9376 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,7 @@ require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' -begin - require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) -rescue LoadError => loaderror - warn "Could not require spec_helper_local: #{loaderror.message}" -end +require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) include RspecPuppetFacts @@ -14,15 +10,19 @@ default_facts = { facterversion: Facter.version, } -default_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')) -default_module_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')) +default_fact_files = [ + File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), + File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), +] -if File.exist?(default_facts_path) && File.readable?(default_facts_path) - default_facts.merge!(YAML.safe_load(File.read(default_facts_path))) -end +default_fact_files.each do |f| + next unless File.exist?(f) && File.readable?(f) && File.size?(f) -if File.exist?(default_module_facts_path) && File.readable?(default_module_facts_path) - default_facts.merge!(YAML.safe_load(File.read(default_module_facts_path))) + begin + default_facts.merge!(YAML.safe_load(File.read(f))) + rescue => e + RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" + end end RSpec.configure do |c| @@ -36,8 +36,8 @@ end def ensure_module_defined(module_name) module_name.split('::').reduce(Object) do |last_module, next_module| - last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module) - last_module.const_get(next_module) + last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) + last_module.const_get(next_module, false) end end