From 443541f19ee0a7c7b41a2e513e2af23c1d90750f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 12 Jun 2024 21:24:41 +0200 Subject: [PATCH 1/2] replace systemd fact with core fact --- REFERENCE.md | 2 +- manifests/config.pp | 2 +- manifests/init.pp | 2 +- manifests/service.pp | 3 --- spec/classes/rabbitmq_spec.rb | 15 ++++----------- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 11882fe4d..5766cbb24 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -537,7 +537,7 @@ Default value: `undef` Data type: `Variant[Integer[-1],Enum['unlimited'],Pattern[/^(infinity|\d+(:(infinity|\d+))?)$/]]` -Set rabbitmq file ulimit. Defaults to 16384. Only available on systems with systemd +Set rabbitmq file ulimit. Defaults to 16384. Only available on Linux Default value: `16384` diff --git a/manifests/config.pp b/manifests/config.pp index 24c89c5a1..2258a33d2 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -220,7 +220,7 @@ } } - if $facts['systemd'] { # systemd fact provided by systemd module + if $facts['kernel'] == 'Linux' { systemd::manage_dropin { 'service-90-limits.conf': unit => "${service_name}.service", selinux_ignore_defaults => ($facts['os']['family'] == 'RedHat'), diff --git a/manifests/init.pp b/manifests/init.pp index 9dec12586..aa942b982 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -170,7 +170,7 @@ # set explicitly if using clustering. If you run Pacemaker and you don't want to use RabbitMQ buildin cluster, you can set config_cluster # to 'False' and set 'erlang_cookie'. # @param file_limit -# Set rabbitmq file ulimit. Defaults to 16384. Only available on systems with systemd +# Set rabbitmq file ulimit. Defaults to 16384. Only available on Linux # @param oom_score_adj # Set rabbitmq-server process OOM score. Defaults to 0. # @param heartbeat diff --git a/manifests/service.pp b/manifests/service.pp index 03849ec7b..52b4623b4 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -27,8 +27,5 @@ hasrestart => true, name => $service_name, } - if $facts['systemd'] and defined(Class['systemd::systemctl::daemon_reload']) { - Class['systemd::systemctl::daemon_reload'] -> Service['rabbitmq-server'] - } } } diff --git a/spec/classes/rabbitmq_spec.rb b/spec/classes/rabbitmq_spec.rb index 32e4e4ade..09cb19fc3 100644 --- a/spec/classes/rabbitmq_spec.rb +++ b/spec/classes/rabbitmq_spec.rb @@ -119,7 +119,7 @@ end ['infinity', -1, 1234].each do |value| - context "with file_limit => '#{value}'", if: os_facts['systemd'] do + context "with file_limit => '#{value}'", if: os_facts['kernel'] == 'Linux' do let(:params) { { file_limit: value } } selinux_ignore_defaults = os_facts[:os]['family'] == 'RedHat' @@ -143,7 +143,7 @@ end [-1000, 0, 1000].each do |value| - context "with oom_score_adj => '#{value}'", if: os_facts['systemd'] do + context "with oom_score_adj => '#{value}'", if: os_facts[:kernel] == 'Linux' do let(:params) { { oom_score_adj: value } } it { is_expected.to contain_systemd__manage_dropin('service-90-limits.conf').with_service_entry({ 'LimitNOFILE' => 16_384, 'OOMScoreAdjust' => value }) } @@ -160,11 +160,11 @@ end end - context 'on systems with systemd', if: os_facts['systemd'] do + context 'on Linux', if: os_facts[:kernel] == 'Linux' do it { is_expected.to contain_systemd__manage_dropin('service-90-limits.conf') } end - context 'on systems without systemd', unless: os_facts['systemd'] do + context 'on non-Linux', unless: os_facts[:kernel] == 'Linux' do it { is_expected.not_to contain_systemd__manage_dropin('service-90-limits.conf') } end @@ -1747,13 +1747,6 @@ } end - context 'on systems with systemd', if: os_facts[:systemd] do - it do - is_expected.to contain_service('rabbitmq-server'). - that_requires('Class[systemd::systemctl::daemon_reload]') - end - end - describe 'service with ensure stopped' do let :params do { service_ensure: 'stopped' } From fc7cda0a2c9242d13a63c6ade8061b8a5ab08460 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 12 Jun 2024 11:40:58 +0200 Subject: [PATCH 2/2] modulesync 9.0.0 --- .github/labeler.yml | 3 +++ .msync.yml | 2 +- Gemfile | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..7899de848 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,3 @@ +--- +skip-changelog: + - head-branch: ['^release-*', 'release'] diff --git a/.msync.yml b/.msync.yml index 876cb3b02..36071685f 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: '8.0.1' +modulesync_config_version: '9.0.0' diff --git a/Gemfile b/Gemfile index ec7b4cd33..27cdc0de2 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 7.2', :require => false + gem 'voxpupuli-test', '~> 8.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 4.0', :require => false