add SELinux role

This commit is contained in:
ikerbs 2021-11-02 17:07:34 +03:00
commit 069cb9b8ee
No known key found for this signature in database
GPG Key ID: 5B42DA4F69B5974B
4 changed files with 35 additions and 0 deletions

8
README.md Normal file
View File

@ -0,0 +1,8 @@
Configure SELinux
Default values:
selinux_policy: 'targeted'
selinux_state: 'permissive'
reboot_requirement: false

4
defaults/main.yml Normal file
View File

@ -0,0 +1,4 @@
---
selinux_policy: 'targeted'
selinux_state: 'permissive'
reboot_requirement: false

5
handlers/main.yml Normal file
View File

@ -0,0 +1,5 @@
---
- name: Reboot
reboot:
when: reboot_requirement

18
tasks/main.yml Normal file
View File

@ -0,0 +1,18 @@
---
- name: Install libselinux-python
package: name=libselinux-python state=present
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version <= '7'
- name: Install python3-libselinux
package: name=python3-libselinux state=present
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '8'
- name: 'Set selinux state'
selinux:
policy: "{{ selinux_policy }}"
state: "{{ selinux_state }}"
notify: Reboot