puppet-openstack-integration/install_modules.sh
Emilien Macchi 1aa6be67c2 workaround to run beaker with puppet4
When running Puppet4, the bin not in $PATH so beaker jobs fail to run
Puppet. Also we use SUDO in OpenStack Infra to run Beaker so we can use
PATH.
This patch is a workaround to make it possible.

Change-Id: Ie25a414f86d9d4b9d60e28d2680a13a503abad8b
2016-06-10 08:49:49 -04:00

36 lines
846 B
Bash
Executable File

#!/bin/bash
set -ex
if [ -n "${GEM_HOME}" ]; then
GEM_BIN_DIR=${GEM_HOME}/bin/
fi
if [ "${PUPPET_MAJ_VERSION}" = 4 ]; then
export PUPPET_BASE_PATH=/etc/puppetlabs/code
export PATH=${PATH}:/opt/puppetlabs/bin
# Workaround to deploy puppet for beaker jobs
sudo -E ln -s /opt/puppetlabs/bin/puppet /usr/sbin/puppet
else
export PUPPET_BASE_PATH=/etc/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'
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)'