diff --git a/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml b/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml index 151e813fec..b6784228d9 100644 --- a/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml +++ b/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml @@ -105,6 +105,21 @@ phases: echo ${!OS} + - name: OperatingSystemVersion + action: ExecuteBash + inputs: + commands: + - | + set -v + FILE=/etc/os-release + if [ -e ${!FILE} ]; then + . ${!FILE} + echo "${!VERSION_ID}" + else + echo "The file '${!FILE}' does not exist. Failing build." + exit {{ FailExitCode }} + fi + # Get platform name - name: PlatformName action: ExecuteBash @@ -176,9 +191,16 @@ phases: set -v OS='{{ build.OperatingSystemName.outputs.stdout }}' PLATFORM='{{ build.PlatformName.outputs.stdout }}' + VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}' if [[ ${!PLATFORM} == RHEL ]]; then + if [[ ${!OS} == rhel9 ]]; then + echo ${!VERSION} > /etc/yum/vars/releasever + yum clean all + fi + yum -y update krb5-libs yum -y groupinstall development && sudo yum -y install curl wget jq + if [[ ${!OS} =~ ^centos ]]; then /bin/sed -r -i -e 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config