Merge "Support puppet5 for bionic"

This commit is contained in:
Zuul 2018-08-22 21:26:36 +00:00 committed by Gerrit Code Review
commit 0eaee6c131
2 changed files with 14 additions and 5 deletions

View File

@ -22,7 +22,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