Skip to content

Commit

Permalink
Merge pull request #514 from traylenator/theres_no_limits
Browse files Browse the repository at this point in the history
Avoid deprecated systemd::service_limits
  • Loading branch information
traylenator authored Apr 15, 2024
2 parents c9ee25c + c2c13bd commit 2d7b5b9
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 2d7b5b9

Please sign in to comment.