Files
puppet-openstack-integration/install_modules.sh
Alfredo Moralejo 42800f0b4c Stable-only: Pin semantic_puppet in CentOS 8
semantic_puppet >= 1.1.0 requires ruby >= 2.7.0 so can no longer be
installed in ruby 2.6.0 in CentOS 8.

Backport note:
This backport removes the version check, because we run no tests in
CentOS 9 in this branch while we run some tests in CentOS 7.
In addition, distro check is also removed, because the same pin is
required in Ubuntu Bionic.

Also, pinning of puppet_forge is removed, because r10k 2.6.4 requires
puppet_forge 2.2.8, which is conflicting with the pin which requires
2.2.6 .

Conflicts:
	install_modules.sh

Closes-Bug: #2016056
Change-Id: Iadff3de808a012c42c2c9a7edb24385c64c7ae78
2023-04-27 11:14:54 +09:00

55 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -ex
GEM_INSTALL_CMD="gem install --no-user-install --minimal-dep --verbose --no-document"
if [ -n "${GEM_HOME}" ]; then
GEM_BIN_DIR=${GEM_HOME}/bin/
export PATH=${PATH}:${GEM_BIN_DIR}
GEM_INSTALL_CMD="${GEM_INSTALL_CMD} --install-dir=$GEM_HOME --bindir=${GEM_BIN_DIR}"
fi
# NOTE(aschultz): since puppet 3 is now EOL, and beaker-puppet_install_helper
# version 0.6.0 has made the agent version the default, we need to symlink
# puppet to the /opt/puppetlabs version when specifically not version 3.
# Workaround to deploy puppet for beaker jobs
if [ -e /opt/puppetlabs/bin/puppet ]; then
export PUPPET_BASE_PATH=/etc/puppetlabs/code
export PATH=${PATH}:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin
sudo -E ln -sfn /opt/puppetlabs/bin/puppet /usr/sbin/puppet
fi
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules}
source $SCRIPT_DIR/functions
print_header 'Start (install_modules.sh)'
print_header 'Install r10k'
# fast_gettext 1.2.0+ requires ruby 2.1.0
# gettext 3.3.0+ requires ruby 2.5.0
# multipart-post 2.2.0 requires ruby 2.3.0
# semantic_puppet >= 1.1.0 requires Ruby >= 2.7.0
cat <<EOF >/tmp/Gemfile
source 'http://rubygems.org'
gem 'fast_gettext', '<1.2.0'
gem 'gettext', '< 3.3.0'
gem 'multipart-post', '<2.2.0'
gem 'semantic_puppet', '<1.1.0'
gem 'r10k', '= 2.6.4'
EOF
$GEM_INSTALL_CMD -g /tmp/Gemfile
# make sure there is no puppet module pre-installed
rm -rf "${PUPPETFILE_DIR:?}/"*
print_header 'Install Modules'
install_modules
print_header 'Module List'
puppet module list
print_header 'Done (install_modules.sh)'