Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On RHEL8/Centos8 python3-libselinux should be installed instead of libselinux-python #5046

Closed
Mosibi opened this issue Aug 6, 2019 · 3 comments · Fixed by #5127
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Mosibi
Copy link
Contributor

Mosibi commented Aug 6, 2019

Installing Kubespray on a RHEL8 systems does not work since the default Python version is 3.6 and thus python3-libselinux should be installed instead of libselinux-python. Even that python2 is still available, the libselinux-python package is not.

TASK [bootstrap-os : Install libselinux-python] *********************************************************************************************************************************************************************************************
Tuesday 06 August 2019 13:20:50 +0000 (0:00:00.137) 0:00:03.850 ********
fatal: [node-4]: FAILED! => {"changed": false, "failures": ["No package libselinux-python available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
fatal: [node-2]: FAILED! => {"changed": false, "failures": ["No package libselinux-python available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
fatal: [node-1]: FAILED! => {"changed": false, "failures": ["No package libselinux-python available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
fatal: [node-3]: FAILED! => {"changed": false, "failures": ["No package libselinux-python available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}

Environment:

  • Cloud provider or hardware configuration:
    KVM nodes

  • OS
    Linux 4.18.0-80.el8.x86_64 x86_64
    NAME="Red Hat Enterprise Linux"
    VERSION="8.0 (Ootpa)"
    ID="rhel"
    ID_LIKE="fedora"
    VERSION_ID="8.0"
    PLATFORM_ID="platform:el8"
    PRETTY_NAME="Red Hat Enterprise Linux 8.0 (Ootpa)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:redhat:enterprise_linux:8.0:GA"
    HOME_URL="https://www.redhat.com/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
    REDHAT_BUGZILLA_PRODUCT_VERSION=8.0
    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
    REDHAT_SUPPORT_PRODUCT_VERSION="8.0"

  • Version of Ansible
    Ansible 2.8.2

Kubespray version (commit) (git rev-parse --short HEAD):
Version 2.10.4 (downloaded tar.gz)

Network plugin used:
Calico

@Mosibi Mosibi added the kind/bug Categorizes issue or PR as related to a bug. label Aug 6, 2019
@Mosibi
Copy link
Contributor Author

Mosibi commented Aug 7, 2019

These changes fix this issue. If i submit a pull request for this, will it be accepted?

diff -ruN kubespray-master/roles/bootstrap-os/tasks/bootstrap-centos.yml kubespray-5046/roles/bootstrap-os/tasks/bootstrap-centos.yml
--- kubespray-master/roles/bootstrap-os/tasks/bootstrap-centos.yml	2019-08-05 09:52:38.000000000 +0000
+++ kubespray-5046/roles/bootstrap-os/tasks/bootstrap-centos.yml	2019-08-07 09:26:40.000000000 +0000
@@ -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: python3-libselinux
+    name: "{{ ( (ansible_facts.distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
     state: present
   become: true
   when:
diff -ruN kubespray-master/roles/kubernetes/preinstall/vars/centos.yml kubespray-5046/roles/kubernetes/preinstall/vars/centos.yml
--- kubespray-master/roles/kubernetes/preinstall/vars/centos.yml	2019-08-05 01:25:47.000000000 +0000
+++ kubespray-5046/roles/kubernetes/preinstall/vars/centos.yml	2019-08-07 09:43:27.000000000 +0000
@@ -1,6 +1,6 @@
 ---
 required_pkgs:
-  - libselinux-python
+  - "{{ ( (ansible_facts.distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
   - device-mapper-libs
   - ebtables
   - nss
diff -ruN kubespray-master/roles/kubernetes/preinstall/vars/redhat.yml kubespray-5046/roles/kubernetes/preinstall/vars/redhat.yml
--- kubespray-master/roles/kubernetes/preinstall/vars/redhat.yml	2019-08-05 09:55:30.000000000 +0000
+++ kubespray-5046/roles/kubernetes/preinstall/vars/redhat.yml	2019-08-07 09:43:14.000000000 +0000
@@ -1,6 +1,6 @@
 ---
 required_pkgs:
-  - python3-libselinux
+  - "{{ ( (ansible_facts.distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}"
   - device-mapper-libs
   - ebtables
   - nss

@Russell-IO
Copy link

@Mosibi, no harm in submitting PR, the team do regularly accept them

@dbwest
Copy link

dbwest commented Mar 23, 2020

When will RHEL 8 be supported as an install target for kubespray?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants