2020-07-20 04:01:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
# Ensure the python3 interpreter and YAML libraries are installed
|
|
|
|
# early (even before package-installs, which is written in Python and
|
|
|
|
# uses YAML).
|
|
|
|
|
|
|
|
if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 7 ]]; then
|
|
|
|
# Our package map and install stuff doesn't have a way to say
|
|
|
|
# "install this from EPEL". So we hack in an install of it here
|
|
|
|
# from EPEL. Nothing else should have installed EPEL at this
|
|
|
|
# early stage.
|
2021-01-27 11:13:44 +00:00
|
|
|
yum install -y python3
|
|
|
|
# NOTE(dpawlik) The epel-release package is not available in RHEL.
|
2022-09-09 08:16:29 +00:00
|
|
|
yum install -y ${DIB_CENTOS_7_PREINSTALL_EPEL_URL_PACKAGE:-https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm}
|
2020-07-20 04:01:10 +00:00
|
|
|
yum install -y python36-PyYAML
|
|
|
|
yum remove -y epel-release
|
2023-11-22 01:56:09 +00:00
|
|
|
elif [[ ${DISTRO_NAME} =~ (centos|rhel|rocky) && ${DIB_RELEASE} > 7 ]]; then
|
2020-07-20 04:01:10 +00:00
|
|
|
# For 8 and above ensure the "user" python3 package is installed
|
|
|
|
# so we have /usr/bin/python3 and pyyaml.
|
2023-11-22 01:56:09 +00:00
|
|
|
${YUM} install -y python3 python3-pyyaml
|
2020-07-20 04:01:10 +00:00
|
|
|
fi
|