Use python3-libselinux on RHEL8/Centos8 (#5127)

* Use python3-libselinux on RHEL8/Centos8

* The fact ansible_facts.distribution_major_version is not present on older Ansible version.
Default it to 0 in when not present and use libselinux-python as package to get current
default behaviour.
This commit is contained in:
Richard Arends 2019-08-28 11:33:15 +02:00 committed by Kubernetes Prow Robot
parent 184ac6a4e6
commit 4d95bb1421
3 changed files with 4 additions and 4 deletions

View file

@ -39,9 +39,9 @@
# libselinux-python is required on SELinux enabled hosts # libselinux-python is required on SELinux enabled hosts
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements # See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
- name: Install libselinux-python - name: Install libselinux python package
package: package:
name: libselinux-python name: "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
state: present state: present
become: true become: true
when: when:

View file

@ -1,6 +1,6 @@
--- ---
required_pkgs: required_pkgs:
- libselinux-python - "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
- device-mapper-libs - device-mapper-libs
- ebtables - ebtables
- nss - nss

View file

@ -1,6 +1,6 @@
--- ---
required_pkgs: required_pkgs:
- libselinux-python - "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
- device-mapper-libs - device-mapper-libs
- ebtables - ebtables
- nss - nss