2017-09-27 05:16:43 +08:00
|
|
|
---
|
|
|
|
- name: check if selinux is enabled
|
|
|
|
command: getenforce
|
|
|
|
register: selinuxstatus
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-27 05:16:43 +08:00
|
|
|
|
2019-04-18 22:02:12 +08:00
|
|
|
- name: if selinux is not disable
|
2019-04-01 23:46:15 +08:00
|
|
|
when: selinuxstatus.stdout != 'Disabled'
|
2019-04-18 22:02:12 +08:00
|
|
|
block:
|
|
|
|
- name: install policycoreutils-python
|
|
|
|
package:
|
|
|
|
name: policycoreutils-python
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
when: ansible_distribution_major_version == '7'
|
2017-09-27 05:16:43 +08:00
|
|
|
|
2020-01-06 22:09:42 +08:00
|
|
|
- name: install nfs-ganesha-selinux and python3-policycoreutils on RHEL 8
|
2019-04-18 22:02:12 +08:00
|
|
|
package:
|
2020-01-06 22:09:42 +08:00
|
|
|
name: ['nfs-ganesha-selinux', 'python3-policycoreutils']
|
2019-04-18 22:02:12 +08:00
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
when: ansible_distribution_major_version == '8'
|
2020-01-06 22:09:42 +08:00
|
|
|
|
|
|
|
- name: add ganesha_t to permissive domain
|
|
|
|
selinux_permissive:
|
|
|
|
name: ganesha_t
|
|
|
|
permissive: true
|
|
|
|
failed_when: false
|