use ansible_facts

This commit is contained in:
ace 2022-01-26 18:17:28 +03:00
parent 3b66729af0
commit 0e9b1d27d4
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0

View File

@ -2,14 +2,14 @@
- name: Install libselinux-python
package: name=libselinux-python state=present
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version <= '7'
- ansible_facts['os_family'] == 'RedHat'
- ansible_facts['distribution_major_version'] <= '7'
- name: Install python3-libselinux
package: name=python3-libselinux state=present
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '8'
- ansible_facts['os_family'] == 'RedHat'
- ansible_facts['distribution_major_version'] == '8'
- name: 'Set selinux state'
selinux: