Skip to content

Commit

Permalink
Ignore SELinux labels for systemd::service_limits
Browse files Browse the repository at this point in the history
The SELinux labels needs to be ignored by the
systemd module or it will not be idempotent.

Bump the systemd minimum version to 2.10.0

Closes: #836
  • Loading branch information
tobias-urdin committed Aug 24, 2020
1 parent b05b6b2 commit 85f3be4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@
if $facts['systemd'] { # systemd fact provided by systemd module
systemd::service_limits { "${service_name}.service":
limits => { 'LimitNOFILE' => $file_limit },
selinux_ignore_defaults => ($facts['os']['family'] == 'RedHat'),
limits => { 'LimitNOFILE' => $file_limit },
# The service will be notified when config changes
restart_service => false,
restart_service => false,
}
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
{
"name": "camptocamp/systemd",
"version_requirement": ">= 2.1.0 < 3.0.0"
"version_requirement": ">= 2.10.0 < 3.0.0"
}
],
"tags": [
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@
end

if facts[:systemd]
selinux_ignore_defaults = facts[:os]['family'] == 'RedHat'

it do
is_expected.to contain_systemd__service_limits("#{name}.service").
with_selinux_ignore_defaults(selinux_ignore_defaults).
with_limits('LimitNOFILE' => value).
with_restart_service(false)
end
Expand Down

0 comments on commit 85f3be4

Please sign in to comment.