mirror of
https://gitea.0xace.cc/ansible-galaxy/selinux.git
synced 2025-01-18 12:02:18 +00:00
add SELinux role
This commit is contained in:
commit
069cb9b8ee
8
README.md
Normal file
8
README.md
Normal file
@ -0,0 +1,8 @@
|
||||
Configure SELinux
|
||||
|
||||
Default values:
|
||||
|
||||
selinux_policy: 'targeted'
|
||||
selinux_state: 'permissive'
|
||||
reboot_requirement: false
|
||||
|
4
defaults/main.yml
Normal file
4
defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
selinux_policy: 'targeted'
|
||||
selinux_state: 'permissive'
|
||||
reboot_requirement: false
|
5
handlers/main.yml
Normal file
5
handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Reboot
|
||||
reboot:
|
||||
when: reboot_requirement
|
18
tasks/main.yml
Normal file
18
tasks/main.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user