Skip to content

Commit

Permalink
Merge pull request #856 from tobias-urdin/selinux_ignore_defaults
Browse files Browse the repository at this point in the history
Ignore SELinux defaults for systemd on RHEL based
  • Loading branch information
ekohl authored Aug 30, 2020
2 parents b05b6b2 + 85f3be4 commit f6b3a8f
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 f6b3a8f

Please sign in to comment.