Support puppet5 for bionic

In our wheel build jobs, we try to install puppet with this script on
bionic nodes.  However, there is no <5 puppet distributions for
bionic.

This detects bionic and installs from puppetlabs (note the name seems
different as it's not pc1 any more)

Change-Id: Ica34b7525bab53f8a6d161401f7fb9a2dbe37bc3
This commit is contained in:
Ian Wienand 2018-08-06 12:51:18 +10:00
parent b1e07b6dbb
commit 40879dae3b
2 changed files with 14 additions and 5 deletions

View File

@ -21,7 +21,9 @@ export PUPPET_VERSION=$(puppet_version)
if [ "$PUPPET_VERSION" == "3" ] ; then
export MODULE_PATH=/etc/puppet/modules
elif [ "$PUPPET_VERSION" == "4" ] ; then
elif [ "$PUPPET_VERSION" == "4" ] || [ "$PUPPET_VERSION" == "5" ]; then
# Using puppetlabs builds for wider compatability across distros
# than system packages provide.
export MODULE_PATH=/etc/puppetlabs/code/modules
else
echo "ERROR: unsupported puppet version $PUPPET_VERSION"

View File

@ -24,10 +24,6 @@ SETUP_PIP=${SETUP_PIP:-true}
# Distro identification functions
# note, can't rely on lsb_release for these as we're bare-bones and
# it may not be installed yet)
PUPPET_VERSION=${PUPPET_VERSION:-3}
function is_fedora {
[ -f /usr/bin/yum ] && cat /etc/*release | grep -q -e "Fedora"
}
@ -57,6 +53,13 @@ if is_fedora && [[ $(lsb_release -rs) -ge 22 ]]; then
YUM=dnf
fi
# Set the puppet version
if cat /etc/os-release | grep -qi bionic; then
# bionic only supports puppet 5
PUPPET_VERSION=${PUPPET_VERSION:-5}
else
PUPPET_VERSION=${PUPPET_VERSION:-3}
fi
#
# Distro specific puppet installs
@ -216,6 +219,10 @@ function setup_puppet_ubuntu {
puppetpkg=puppet-agent
PUPPET_VERSION=4.*
FACTER_VERSION=3.*
elif [ "$PUPPET_VERSION" == "5" ] ; then
puppet_deb=puppet5-release-bionic.deb
PUPPET_VERSION=5.*
FACTER_VERSION=3.*
else
echo "Unsupported puppet version ${PUPPET_VERSION}"
exit 1