Skip to content

Commit

Permalink
Avoid deprecated systemd::service_limits
Browse files Browse the repository at this point in the history
`systemd::service_limits` was deprecated

voxpupuli/puppet-systemd#437
  • Loading branch information
traylenator committed Apr 12, 2024
1 parent c9ee25c commit c2c13bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,13 @@
}
} else {
if $ulimit_managed {
systemd::service_limits { "${service_name}.service":
limits => {
systemd::manage_dropin { "${service_name}-90-limits.conf":
ensure => present,
unit => "${service_name}.service",
service_entry => {
'LimitNOFILE' => $ulimit,
},
restart_service => false,
notify_service => false,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ class { 'redis':
is_expected.to contain_file("/etc/systemd/system/#{service_name}.service.d/limit.conf").
with_ensure('absent')

is_expected.to contain_systemd__service_limits("#{service_name}.service").
with_limits({ 'LimitNOFILE' => 7777 }).
with_restart_service(false).
with_ensure('present')
is_expected.to contain_systemd__manage_dropin("#{service_name}-90-limits.conf").
with_service_entry({ 'LimitNOFILE' => 7777 }).
with_ensure('present').
with_unit("#{service_name}.service")
end
end

Expand Down

0 comments on commit c2c13bd

Please sign in to comment.