redhat-cop / infra.leapp

Collection of Ansible roles for automating RHEL in-place upgrades using Leapp.
MIT License
44 stars 34 forks source link

selinux_mode variable fails to set a value if the target server has selinux disabled #124

Closed scott-vick closed 11 months ago

scott-vick commented 11 months ago

The selinux_mode default variable uses a fact generated during the pre-ripu analysis. However if the server has selinux set to disabled, the correct fact (config_mode) is not created and therefore causes a failure during the selinux mode configuration tasks, due to a missing variable.

The facts generated when selinux is active (enforcing or permissive):

"ansible_selinux": {
      "config_mode": "enforcing",
      "mode": "enforcing",
      "policyvers": 31,
      "status": "enabled",
      "type": "targeted"
},

The facts generated when selinux is disabled:

"ansible_selinux": {
      "status": "disabled"
},
scott-vick commented 11 months ago

Created fix and submitted PR# 125