diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83c9c329..ab21e5fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ name: CI +# yamllint disable-line rule:truthy on: pull_request: {} push: @@ -18,7 +19,7 @@ concurrency: jobs: puppet: name: Puppet - uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2 + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3 with: timeout_minutes: 75 unit_runs_on: 'cern-self-hosted' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 66127cd0..73be88dc 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -4,6 +4,7 @@ name: "Pull Request Labeler" +# yamllint disable-line rule:truthy on: pull_request_target: {} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93b33c2b..4adf65cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ name: Release +# yamllint disable-line rule:truthy on: push: tags: @@ -12,7 +13,7 @@ on: jobs: release: name: Release - uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2 + uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v3 with: allowed_owner: 'voxpupuli' secrets: diff --git a/.msync.yml b/.msync.yml index 95e8c977..ac84b45d 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: '9.1.0' +modulesync_config_version: '9.3.0' diff --git a/.pmtignore b/.pmtignore index 10b98306..a9d37aa0 100644 --- a/.pmtignore +++ b/.pmtignore @@ -20,6 +20,7 @@ /.github/ /.librarian/ /Puppetfile.lock +/Puppetfile *.iml /.editorconfig /.fixtures.yml diff --git a/Gemfile b/Gemfile index 7123c663..2ac98f89 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ end gem 'rake', :require => false gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test] -puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 7.24' +puppetversion = ENV['PUPPET_GEM_VERSION'] || [">= 7.24", "< 9"] gem 'puppet', puppetversion, :require => false, :groups => [:test] # vim: syntax=ruby diff --git a/manifests/install.pp b/manifests/install.pp index a198bb9c..26f64a7b 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -11,7 +11,7 @@ } } - if $collectd::utils and ( $facts['os']['family'] == 'Debian' or ( $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'8') >= 0 )) { + if $collectd::utils and ( $facts['os']['family'] == 'Debian' or $facts['os']['family'] == 'RedHat' ) { package { 'collectd-utils': ensure => $collectd::package_ensure, } diff --git a/manifests/plugin/python.pp b/manifests/plugin/python.pp index fb505c82..ba4add2d 100644 --- a/manifests/plugin/python.pp +++ b/manifests/plugin/python.pp @@ -31,8 +31,7 @@ $ensure_real = 'absent' } - if $facts['os']['name'] == 'Amazon' or - ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'8') >= 0) { + if $facts['os']['name'] == 'Amazon' or ($facts['os']['family'] == 'RedHat') { if $_manage_package { package { 'collectd-python': ensure => $ensure_real, diff --git a/manifests/plugin/rabbitmq.pp b/manifests/plugin/rabbitmq.pp index 291fe686..c623ffec 100644 --- a/manifests/plugin/rabbitmq.pp +++ b/manifests/plugin/rabbitmq.pp @@ -61,9 +61,7 @@ ) { include collectd - if $facts['os']['family'] == 'Debian' or - $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '8') >= 0 or - $facts['os']['name'] == 'Ubuntu' { + if $facts['os']['family'] == 'Debian' or $facts['os']['family'] == 'RedHat' { fail('https://pypi.org/project/collectd-rabbitmq/ does not support Python 3') } diff --git a/manifests/plugin/write_http.pp b/manifests/plugin/write_http.pp index 3b993b51..56f95dbb 100644 --- a/manifests/plugin/write_http.pp +++ b/manifests/plugin/write_http.pp @@ -19,10 +19,10 @@ if $manage_package !~ Undef { $_manage_package = $manage_package } else { - if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'8') >= 0 { - $_manage_package = true + $_manage_package = if $facts['os']['family'] == 'RedHat' { + true } else { - $_manage_package = false + false } } if $_manage_package { diff --git a/metadata.json b/metadata.json index 64500910..5e6a9196 100644 --- a/metadata.json +++ b/metadata.json @@ -33,7 +33,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7", "8", "9" ] @@ -41,25 +40,16 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7", - "8", "9" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "7", "8", "9" ] }, - { - "operatingsystem": "Scientific", - "operatingsystemrelease": [ - "7" - ] - }, { "operatingsystem": "Debian", "operatingsystemrelease": [ @@ -77,7 +67,6 @@ { "operatingsystem": "FreeBSD", "operatingsystemrelease": [ - "12", "13", "14" ] diff --git a/spec/classes/collectd_plugin_rabbitmq_spec.rb b/spec/classes/collectd_plugin_rabbitmq_spec.rb index 8f55956d..f25ced6a 100644 --- a/spec/classes/collectd_plugin_rabbitmq_spec.rb +++ b/spec/classes/collectd_plugin_rabbitmq_spec.rb @@ -26,7 +26,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it 'import collectd_rabbitmq.collectd_plugin in python-config' do @@ -69,7 +69,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it 'override custom TypesDB' do @@ -84,7 +84,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it 'override Username to foo in python-config' do @@ -99,7 +99,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it 'override Username to foo in python-config' do @@ -114,7 +114,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it 'override Username to foo in python-config' do @@ -130,7 +130,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it 'Will remove python-config' do @@ -157,7 +157,7 @@ end case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8], %w[Ubuntu 20.04] + when %w[RedHat 8], %w[RedHat 9], %w[Ubuntu 20.04] it { is_expected.to raise_error(%r{does not support Python 3}) } else it do diff --git a/spec/classes/collectd_plugin_write_http_spec.rb b/spec/classes/collectd_plugin_write_http_spec.rb index eef7e745..2254fe48 100644 --- a/spec/classes/collectd_plugin_write_http_spec.rb +++ b/spec/classes/collectd_plugin_write_http_spec.rb @@ -33,8 +33,8 @@ ) end - case [facts['os']['family'], facts['os']['release']['major']] - when %w[RedHat 8] + case facts['os']['family'] + when 'RedHat' it { is_expected.to contain_package('collectd-write_http') } else it { is_expected.not_to contain_package('collectd-write_http') } diff --git a/spec/spec_helper_methods.rb b/spec/spec_helper_methods.rb index 9595fa59..4a6e1700 100644 --- a/spec/spec_helper_methods.rb +++ b/spec/spec_helper_methods.rb @@ -22,7 +22,7 @@ def baseline_os_hash supported_os: [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => %w[7 8] + 'operatingsystemrelease' => %w[9] } ] }