ansible.posix.selinux – Change policy and state of SELinux¶
This plugin is part of the ansible.posix collection.
To install it use:
ansible-galaxy collection install ansible.posix.
To use it in a playbook, specify:
New in version 1.0.0: of ansible.posix
Configures the SELinux mode and policy.
A reboot may be required after usage.
Ansible will not issue this reboot but will let you know when it is required.
The below requirements are needed on the host that executes this module.
- name: Enable SELinux ansible.posix.selinux: policy: targeted state: enforcing - name: Put SELinux in permissive mode, logging actions that would be blocked. ansible.posix.selinux: policy: targeted state: permissive - name: Disable SELinux ansible.posix.selinux: state: disabled
Common return values are documented here, the following are the fields unique to this module: