Stable-only: Pin ruby packages in CentOS 8

This change introduces pinning of a few packages to avoid installing
versions incompatible with old Ruby 2.5 in CentOS 8. Note that this
change is submitted to stable/yoga and older stable branches because
CentOS 8 support has been removed during Zed cycle and we no longer
have CentOS 8 integration jobs since then.

Closes-Bug: #1998739
Change-Id: I1b5ebe109b7d0647f324e84b465ed4960f8749f1
(cherry picked from commit 394084fa22)
This commit is contained in:
Takashi Kajinami 2022-12-05 13:25:22 +09:00
parent 3e9b78d871
commit b242eceedc
1 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,8 @@
#!/bin/bash
set -ex
source /etc/os-release
export OS_NAME_VERS=${ID}${VERSION_ID}
GEM_INSTALL_CMD="gem install --no-user-install --minimal-dep --verbose --no-document"
if [ -n "${GEM_HOME}" ]; then
@ -25,7 +26,17 @@ source $SCRIPT_DIR/functions
print_header 'Start (install_modules.sh)'
print_header 'Install r10k'
$GEM_INSTALL_CMD r10k
if [ "${OS_NAME_VERS}" == "centos8" ]; then
# faraday-net_http >= 3.0.0 supports only Ruby 2.6.0 but CentOS 8 provides
# Ruby 2.5.0
$GEM_INSTALL_CMD faraday-net_http -v '< 3.0.0'
# Pin a few more packages to avoid updating faraday-net_http
$GEM_INSTALL_CMD faraday -v '< 2.0.0'
$GEM_INSTALL_CMD r10k -v '< 3.15.0'
else
$GEM_INSTALL_CMD r10k
fi
# make sure there is no puppet module pre-installed
rm -rf "${PUPPETFILE_DIR:?}/"*