ansible-collection-prometheus/roles/node_exporter/tasks/selinux.yml
SuperQ 1d98aee69a
Fix up ansible-lint issues.
Signed-off-by: SuperQ <superq@gmail.com>
2022-09-24 10:55:09 +02:00

39 lines
1.4 KiB
YAML

---
- name: Install selinux python packages [RHEL]
ansible.builtin.package:
name:
- "{{ ( (ansible_facts.distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
- "{{ ( (ansible_facts.distribution_major_version | int) < 8) | ternary('policycoreutils-python','python3-policycoreutils') }}"
state: present
register: _install_selinux_packages
until: _install_selinux_packages is success
retries: 5
delay: 2
when:
- (ansible_distribution | lower == "redhat") or
(ansible_distribution | lower == "centos")
- name: Install selinux python packages [Fedora]
ansible.builtin.package:
name:
- "{{ ( (ansible_facts.distribution_major_version | int) < 29) | ternary('libselinux-python','python3-libselinux') }}"
- "{{ ( (ansible_facts.distribution_major_version | int) < 29) | ternary('policycoreutils-python','python3-policycoreutils') }}"
state: present
register: _install_selinux_packages
until: _install_selinux_packages is success
retries: 5
delay: 2
when:
- ansible_distribution | lower == "fedora"
- name: Install selinux python packages [clearlinux]
ansible.builtin.package:
name: sysadmin-basic
state: present
register: _install_selinux_packages
until: _install_selinux_packages is success
retries: 5
delay: 2
when:
- ansible_distribution | lower == "clearlinux"