Commit Graph

1 Commits (nut-monitor)

Author SHA1 Message Date
Dustin bc4c7edbad r/base: Clear facts after installing python-selinux
If the Python bindings for SELinux policy management are not installed
when Ansible gathers host facts, no SELinux-related facts will be set.
Thus, any tasks that are conditional based on these facts will not run.
Typically, such tasks are required for SELinux-enabled hosts, but must
not be performed for non-SELinux hosts.  If they are not run when they
should, the deployment may fail or applications may experience issues at
runtime.

To avoid these potential issues, the *base* role now forces Ansible to
gather facts again if it installed the Python SELinux bindings.

Note: one might suggest using `meta: clear_facts` instead of `setup` and
letting Ansible decide if and when to gather facts again. Unfortunately,
this for some reason doesn't work; the `clear_facts` meta task just
causes Ansible to crash with a "shared connection to {host} closed."
2022-12-23 08:44:30 -06:00