Alex Schultz 7f9907baa6 Drop puppet3 support
Puppet 3 was EOL as of December 31, 2016. Since we don't use it in the
gate for Pike, let's drop the configuration bits in p-o-i for it. This
change leaves the PUPPET_MAJ_VERSION support on the off chance we need
it in the future but basically 4 is currently the only supported
version.

Change-Id: I0f04a3cb194ec2225010fb4e062703195b79baf1
2017-05-26 13:43:35 -06:00

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -ex
if [ -n "${GEM_HOME}" ]; then
GEM_BIN_DIR=${GEM_HOME}/bin/
export PATH=${PATH}:${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.
export PUPPET_BASE_PATH=/etc/puppetlabs/code
export PATH=${PATH}:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin
# Workaround to deploy puppet for beaker jobs
sudo -E ln -sfn /opt/puppetlabs/bin/puppet /usr/sbin/puppet
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
gem install fast_gettext -v '< 1.2.0'
gem install r10k --no-ri --no-rdoc
# 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)'