Skip to content

Commit f52883f

Browse files
committed
Add Puppet 8 support
1 parent 7f3da85 commit f52883f

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

manifests/config.pp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,13 @@
221221
}
222222
223223
if $facts['systemd'] { # systemd fact provided by systemd module
224-
systemd::service_limits { "${service_name}.service":
224+
systemd::manage_dropin { 'service-90-limits.conf':
225+
unit => "${service_name}.service",
225226
selinux_ignore_defaults => ($facts['os']['family'] == 'RedHat'),
226-
limits => {
227+
service_entry => {
227228
'LimitNOFILE' => $file_limit,
228229
'OOMScoreAdjust' => $oom_score_adj,
229230
},
230-
# The service will be notified when config changes
231-
restart_service => false,
232231
}
233232
}
234233

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
{
6868
"name": "puppet/systemd",
69-
"version_requirement": ">= 2.10.0 < 8.0.0"
69+
"version_requirement": ">= 4.0.0 < 8.0.0"
7070
}
7171
],
7272
"tags": [

spec/classes/rabbitmq_spec.rb

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@
125125
selinux_ignore_defaults = os_facts[:os]['family'] == 'RedHat'
126126

127127
it do
128-
is_expected.to contain_systemd__service_limits("#{name}.service").
128+
is_expected.to contain_systemd__manage_dropin('service-90-limits.conf').
129129
with_selinux_ignore_defaults(selinux_ignore_defaults).
130-
with_limits({ 'LimitNOFILE' => value, 'OOMScoreAdjust' => 0 }).
131-
with_restart_service(false)
130+
with_service_entry({ 'LimitNOFILE' => value, 'OOMScoreAdjust' => 0 })
132131
end
133132
end
134133
end
@@ -147,11 +146,7 @@
147146
context "with oom_score_adj => '#{value}'", if: os_facts['systemd'] do
148147
let(:params) { { oom_score_adj: value } }
149148

150-
it do
151-
is_expected.to contain_systemd__service_limits("#{name}.service").
152-
with_limits({ 'LimitNOFILE' => 16_384, 'OOMScoreAdjust' => value }).
153-
with_restart_service(false)
154-
end
149+
it { is_expected.to contain_systemd__manage_dropin('service-90-limits.conf').with_service_entry({ 'LimitNOFILE' => 16_384, 'OOMScoreAdjust' => value }) }
155150
end
156151
end
157152

@@ -166,14 +161,11 @@
166161
end
167162

168163
context 'on systems with systemd', if: os_facts['systemd'] do
169-
it do
170-
is_expected.to contain_systemd__service_limits("#{name}.service").
171-
with_restart_service(false)
172-
end
164+
it { is_expected.to contain_systemd__manage_dropin('service-90-limits.conf') }
173165
end
174166

175167
context 'on systems without systemd', unless: os_facts['systemd'] do
176-
it { is_expected.not_to contain_systemd__service_limits("#{name}.service") }
168+
it { is_expected.not_to contain_systemd__manage_dropin('service-90-limits.conf') }
177169
end
178170

179171
context 'with admin_enable set to true' do

0 commit comments

Comments
 (0)