-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid puppet errors when SELinux is disabled #295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you have a look at rubocop?
Updated selinux types to avoid runtime errors when SELinux is disabled. selinux::boolean, selinux::fcontext, and selinux::port will now essentially do nothing when SELinux is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I suppose users who disable SELinux aren't prone to doing it by accident, so we might as well not make noise about it.
@ekohl can you take another look and merge if there are no issues? |
value => $value, | ||
persistent => $persistent, | ||
# Do nothing unless SELinux is enabled | ||
if $facts['selinux'] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the selinux
fact a hash though (thus always true)?
selinux (map) — Represents information about Security-Enhanced Linux (SELinux).
config_mode (string) — The configured SELinux mode.
config_policy (string) — The configured SELinux policy.
current_mode (string) — The current SELinux mode.
enabled (boolean) — True if SELinux is enabled or false if not.
enforced (boolean) — True if SELinux policy is enforced or false if not.
policy_version (string) — The version of the SELinux policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my mistake. selinux
is a boolean legacy fact. The new fact is os['selinux']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which you've already covered in great detail in this thread. I'll get my coat... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This needs to be done for |
Could you open a new issue/pr for that? Comments on a closed PR generally don't result in any code change. |
@jorhett It should be a simple fix to handle systems running in permissive mode. Can you create a new issue regarding this? This PR has already been merged. |
Avoid puppet errors when SELinux is disabled
Fixes #286. Puppet will no longer display a runtime error when applying a manifest on a node with selinux disabled. These changes essentially make the
selinux::boolean
,selinux::fcontext
, andselinux::port
types do nothing when SELinux is disabled.