diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index e905e0c940..d9005bea0c 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -64,12 +64,19 @@ determine_distro # Prefer dnf over yum for CentOS. which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum' + # Install the base packages case ${DISTRO_ID} in centos|rhel) + # NOTE(mnaser): libselinux-python3 will likely not exist until CentOS 7.8 and + # we need to unblock our gates to be able to use Python 3, so we + # use this temporary repository. This should be removed once + # CentOS 7 releases libselinux-2.5-15. + curl https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/8709ca2640344a4ba85cba0a1d6eea69/libselinux-2.5-15/libselinux.repo \ + -o /etc/yum.repos.d/libselinux.repo $RHT_PKG_MGR -y install \ git curl autoconf gcc gcc-c++ nc \ - python2 python2-devel \ + python3 python3-devel libselinux-python3 \ openssl-devel libffi-devel \ libselinux-python python-virtualenv ;; diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index 3c0b85b3bf..be5abf0ead 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -86,8 +86,8 @@ function build_ansible_runtime_venv { $PIP_COMMAND install -e . # Add SELinux support to the venv - if [ -d "/usr/lib64/python2.7/site-packages/selinux/" ]; then - rsync -avX /usr/lib64/python2.7/site-packages/selinux/ /opt/ansible-runtime/lib64/python2.7/selinux/ + if [ -d "/usr/lib64/python3.6/site-packages/selinux/" ]; then + rsync -avX /usr/lib64/python3.6/site-packages/selinux/ /opt/ansible-runtime/lib64/python3.6/selinux/ fi }