Skip to content

Commit

Permalink
Use python3-libselinux on RHEL8/Centos8 (kubernetes-sigs#5127)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Mosibi authored and LuckySB committed Dec 8, 2019
1 parent 9761e92 commit cfafc10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions roles/bootstrap-os/tasks/bootstrap-centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

# libselinux-python is required on SELinux enabled hosts
# 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:
name: libselinux-python
name: "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
state: present
become: true
when:
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes/preinstall/vars/centos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
required_pkgs:
- libselinux-python
- "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
- device-mapper-libs
- ebtables
- nss
2 changes: 1 addition & 1 deletion roles/kubernetes/preinstall/vars/redhat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
required_pkgs:
- libselinux-python
- "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
- device-mapper-libs
- ebtables
- nss

0 comments on commit cfafc10

Please sign in to comment.