Commit 566c230
committed
Fix SELinux ansible variable name conflict
The ansible remediation for both selinux_not_disabled and selinux_state
rules were using 'selinux_state' as the registered variable name for the
output of the 'getenforce' command. This created a naming conflict with
the 'selinux_state' boolean control (which comes from the rule id)
variable used in the when conditions to determine if a rule should be applied.
When roles are generated, the 'Check current SELinux state' task includes
a when condition with 'selinux_state | bool' (coming from the rule id),
but this creates a circular dependency since that same task is supposed
to register 'selinux_state'.
As a result, the task gets skipped, the variable never gets registered,
and subsequent tasks that depend on checking the current SELinux state
fail or are skipped.
This fix renames the registered variable from 'selinux_state' to
'current_selinux_state' in both ansible remediation files to avoid
the naming conflict.
Fixes: #143441 parent 3e27ad8 commit 566c230
2 files changed
Lines changed: 4 additions & 4 deletions
File tree
- linux_os/guide/system/selinux
- selinux_not_disabled/ansible
- selinux_state/ansible
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
0 commit comments