Skip to content

OS harden will not enable SELinux if SELinux is disabled #537

Open
@bgbak

Description

@bgbak

Describe the bug
In the OS Hardening role SELinux will not be enabled if SELinux is already disabled

Expected behavior
Expect SELinux to be enabled and configured.
Actual behavior

TASK [devsec.hardening.os_hardening : Configure selinux | selinux-01] ********** 
skipping: [SELinux-Disabled]
ok: [SELinux-Enabled]

Example Playbook

---
- hosts: all
  collections:
    - devsec_hardening
  roles:
    - os_hardening

OS / Environment

Both targets running CentOS 7

Ansible Version

AWX 0.20.0 on k3s.
quay.io/ansible/awx-ee:latest as execution eniroment. No modifications

Role Version

7.14.1

Additional context
This conditional will return false if SELinux is not enabled

- ansible_facts.selinux.status == 'enabled'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions