From cfa17827335e0c0d544a9faa89440b7fed5ff740 Mon Sep 17 00:00:00 2001 From: Massimiliano Adamo Date: Sat, 15 Apr 2023 10:37:59 +0200 Subject: [PATCH 1/6] modulesync 5.5.0 --- .gitignore | 36 +++++++++++++++--------------- .msync.yml | 2 +- .pmtignore | 64 +++++++++++++++++++++++++++--------------------------- Gemfile | 3 +-- Rakefile | 36 ++++-------------------------- 5 files changed, 56 insertions(+), 85 deletions(-) diff --git a/.gitignore b/.gitignore index 9b95224ce..84fd904ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,23 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -pkg/ -Gemfile.lock -Gemfile.local -vendor/ -.vendor/ -spec/fixtures/manifests/ -spec/fixtures/modules/ -.vagrant/ -.bundle/ -.ruby-version -coverage/ -log/ -.idea/ -.dependencies/ -.librarian/ -Puppetfile.lock +/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 +/.yardoc/ +/Guardfile diff --git a/.msync.yml b/.msync.yml index f3156d15e..a4b006918 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '5.4.0' +modulesync_config_version: '5.5.0' diff --git a/.pmtignore b/.pmtignore index 65f505149..58a040887 100644 --- a/.pmtignore +++ b/.pmtignore @@ -1,37 +1,37 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -docs/ -pkg/ -Gemfile -Gemfile.lock -Gemfile.local -vendor/ -.vendor/ -spec/ -Rakefile -.vagrant/ -.bundle/ -.ruby-version -coverage/ -log/ -.idea/ -.dependencies/ -.github/ -.librarian/ -Puppetfile.lock +/docs/ +/pkg/ +/Gemfile +/Gemfile.lock +/Gemfile.local +/vendor/ +/.vendor/ +/spec/ +/Rakefile +/.vagrant/ +/.bundle/ +/.ruby-version +/coverage/ +/log/ +/.idea/ +/.dependencies/ +/.github/ +/.librarian/ +/Puppetfile.lock *.iml -.editorconfig -.fixtures.yml -.gitignore -.msync.yml -.overcommit.yml -.pmtignore -.rspec -.rspec_parallel -.rubocop.yml -.sync.yml +/.editorconfig +/.fixtures.yml +/.gitignore +/.msync.yml +/.overcommit.yml +/.pmtignore +/.rspec +/.rspec_parallel +/.rubocop.yml +/.sync.yml .*.sw? -.yardoc/ -.yardopts -Dockerfile +/.yardoc/ +/.yardopts +/Dockerfile diff --git a/Gemfile b/Gemfile index 557f2c49e..1d6e24469 100644 --- a/Gemfile +++ b/Gemfile @@ -23,8 +23,7 @@ end group :release do gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5' - gem 'voxpupuli-release', '>= 1.2.0', :require => false - gem 'puppet-strings', '>= 2.2', :require => false + gem 'voxpupuli-release', '~> 2.0', :require => false end gem 'rake', :require => false diff --git a/Rakefile b/Rakefile index c64131ae4..90c180a1a 100644 --- a/Rakefile +++ b/Rakefile @@ -24,6 +24,10 @@ end begin require 'voxpupuli/release/rake_tasks' rescue LoadError + # voxpupuli-release not present +else + GCGConfig.user = 'voxpupuli' + GCGConfig.project = 'puppet-zabbix' end desc "Run main 'test' task and report merged results to coveralls" @@ -37,36 +41,4 @@ task test_with_coveralls: [:test] do end end -desc 'Generate REFERENCE.md' -task :reference, [:debug, :backtrace] do |t, args| - patterns = '' - Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace]) -end - -begin - require 'github_changelog_generator/task' - require 'puppet_blacksmith' - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - metadata = Blacksmith::Modulefile.new - config.future_release = "v#{metadata.version}" if metadata.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' - config.project = 'puppet-zabbix' - end - - # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 - require 'rbconfig' - if RbConfig::CONFIG['host_os'] =~ /linux/ - task :changelog do - puts 'Fixing line endings...' - changelog_file = File.join(__dir__, 'CHANGELOG.md') - changelog_txt = File.read(changelog_file) - new_contents = changelog_txt.gsub(%r{\r\n}, "\n") - File.open(changelog_file, "w") {|file| file.puts new_contents } - end - end - -rescue LoadError -end # vim: syntax=ruby From 6773fd8f0590fe87b1494315952202be71e66b43 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 May 2023 15:22:31 +0200 Subject: [PATCH 2/6] modulesync 6.0.0 --- .msync.yml | 2 +- Gemfile | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.msync.yml b/.msync.yml index a4b006918..b929160c9 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '5.5.0' +modulesync_config_version: '6.0.0' diff --git a/Gemfile b/Gemfile index 1d6e24469..7e0f72873 100644 --- a/Gemfile +++ b/Gemfile @@ -4,10 +4,10 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 5.4', :require => false + gem 'voxpupuli-test', '~> 6.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false - gem 'puppet_metadata', '~> 2.0', :require => false + gem 'puppet_metadata', '~> 3.0', :require => false gem 'fakefs', :require => false gem 'zabbixapi', :require => false end @@ -18,18 +18,19 @@ group :development do end group :system_tests do - gem 'voxpupuli-acceptance', '~> 1.0', :require => false + gem 'voxpupuli-acceptance', '~> 2.0', :require => false end group :release do - gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5' - gem 'voxpupuli-release', '~> 2.0', :require => false + gem 'github_changelog_generator', '>= 1.16.1', :require => false + gem 'voxpupuli-release', '~> 3.0', :require => false + gem 'faraday-retry', '~> 2.1', :require => false end gem 'rake', :require => false gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test] -puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0' +puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 7.24' gem 'puppet', puppetversion, :require => false, :groups => [:test] # vim: syntax=ruby From 5b3aabff9d46f1b134a0b0a4fdabdd37b244af99 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 17 Aug 2023 17:52:25 +0200 Subject: [PATCH 3/6] modulesync 7.0.0 --- .github/CONTRIBUTING.md | 11 +++++++---- .msync.yml | 2 +- Gemfile | 2 +- spec/spec_helper.rb | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8b466cfb9..6aaa603ff 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -232,18 +232,21 @@ simple tests against it after applying the module. You can run this with: ```sh -BEAKER_setfile=debian11-64 bundle exec rake beaker +BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker ``` -You can replace the string `debian10` with any common operating system. +You can replace the string `debian11` with any common operating system. The following strings are known to work: -* ubuntu1804 * ubuntu2004 -* debian10 +* ubuntu2204 * debian11 * centos7 * centos8 +* centos9 +* almalinux8 +* almalinux9 +* fedora36 For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests). diff --git a/.msync.yml b/.msync.yml index b929160c9..dd3e95722 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '6.0.0' +modulesync_config_version: '7.0.0' diff --git a/Gemfile b/Gemfile index 7e0f72873..fc243de77 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 6.0', :require => false + gem 'voxpupuli-test', '~> 7.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 3.0', :require => false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a68e7dbe8..0aec83fe7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,3 +25,4 @@ require 'support/acceptance/supported_versions' require 'spec_helper_methods' +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } From 94507792924612cee391f3a9aa75093c9c8094ba Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 18 Aug 2023 08:51:31 +0200 Subject: [PATCH 4/6] rubocop: autofix --- .rubocop_todo.yml | 23 +++++++++++-------- spec/unit/puppet/type/zabbix_template_spec.rb | 4 +--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a28f73a01..de61065fa 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2022-03-09 21:00:49 UTC using RuboCop version 1.22.3. +# on 2023-08-17 21:27:12 UTC using RuboCop version 1.50.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -19,26 +19,29 @@ Lint/MissingSuper: Exclude: - 'spec/serverspec_type_zabbixapi.rb' -# Offense count: 7 +# Offense count: 1 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: Exclude: - 'lib/puppet/provider/zabbix_proxy/ruby.rb' - - 'lib/puppet/type/zabbix_host.rb' - - 'lib/puppet/type/zabbix_template.rb' -# Offense count: 4 +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/BeEq: + Exclude: + - 'spec/acceptance/zabbix_proxy_spec.rb' + - 'spec/unit/puppet/type/zabbix_template_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). RSpec/EmptyExampleGroup: Exclude: - 'spec/classes/agent_spec.rb' - - 'spec/classes/javagateway_spec.rb' - - 'spec/classes/server_spec.rb' -# Offense count: 4 +# Offense count: 2 RSpec/RepeatedExampleGroupDescription: Exclude: - - 'spec/classes/database_mysql_spec.rb' - 'spec/defines/startup_spec.rb' # Offense count: 1 diff --git a/spec/unit/puppet/type/zabbix_template_spec.rb b/spec/unit/puppet/type/zabbix_template_spec.rb index 085a83271..9f650dcb5 100644 --- a/spec/unit/puppet/type/zabbix_template_spec.rb +++ b/spec/unit/puppet/type/zabbix_template_spec.rb @@ -116,9 +116,7 @@ content EOS FileUtils.mkdir_p '/path/to' - File.open(mock_template_source_file, 'w') do |f| - f.write mock_file_content - end + File.write(mock_template_source_file, mock_file_content) expect(property.source_xml).to eq mock_file_content end end From 1c5968393285562139c41ec4f5e1e1c7fa44a2de Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 3 Oct 2023 09:40:30 +0200 Subject: [PATCH 5/6] only install SCL repo on CentOS --- manifests/repo.pp | 2 +- spec/classes/repo_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/repo.pp b/manifests/repo.pp index 7890343c6..384a6c1a4 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -87,7 +87,7 @@ } } - if ($facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) { + if ($facts['os']['name'] == 'CentOS' and $facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) { package { 'zabbix-required-scl-repo': ensure => 'latest', name => 'centos-release-scl', diff --git a/spec/classes/repo_spec.rb b/spec/classes/repo_spec.rb index f3ad90c65..c67fa975c 100644 --- a/spec/classes/repo_spec.rb +++ b/spec/classes/repo_spec.rb @@ -110,7 +110,7 @@ it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/7/$basearch/') } it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } - it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('centos-release-scl') } + it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('centos-release-scl') } if facts[:os]['name'] == 'CentOS' end when '9' From 6a2ccb8ba63e22b7fce21724429938acf2fc6585 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 3 Oct 2023 12:40:45 +0200 Subject: [PATCH 6/6] use firewall 6.0 in fixtures and allow it --- .fixtures.yml | 4 +++- metadata.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 8bcecca57..9af298411 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,7 +2,9 @@ fixtures: repositories: apache: https://github.com/puppetlabs/puppetlabs-apache.git apt: https://github.com/puppetlabs/puppetlabs-apt.git - firewall: https://github.com/puppetlabs/puppetlabs-firewall + firewall: + repo: https://github.com/puppetlabs/puppetlabs-firewall + ref: v6.0.0 stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git concat: https://github.com/puppetlabs/puppetlabs-concat.git postgresql: https://github.com/puppetlabs/puppet-postgresql.git diff --git a/metadata.json b/metadata.json index bdcee59e3..c6f5ed8ec 100644 --- a/metadata.json +++ b/metadata.json @@ -22,7 +22,7 @@ }, { "name": "puppetlabs/firewall", - "version_requirement": ">= 1.7.0 < 4.0.0" + "version_requirement": ">= 1.7.0 < 7.0.0" }, { "name": "puppetlabs/apt",