From b5ca31399a7052467f74591fd8d19c1a79542ea1 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Wed, 2 May 2018 20:57:42 +0200 Subject: [PATCH] Use latest puppet5 repos This change makes sure the latest puppet5 version is used when running integration jobs for puppet5. The puppetlabs yum mirror is ready to be used and has the proper packages and is mirrored, example: * http://mirror.mtl01.inap.openstack.org/yum-puppetlabs/puppet5/ For the puppetlabs apt mirror the puppet5 pool is needed before this will work. A patch has been fixed for that here [1]. Therefore this change cannot be merged until [1] is merged. [1] https://review.openstack.org/#/c/565867/ Change-Id: I1a2716fdd4b960b12ff24303038bec5ea8fb80a3 --- functions | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 56bda86b9..0f4607405 100644 --- a/functions +++ b/functions @@ -124,10 +124,13 @@ print_header() { install_puppet() { if uses_debs; then print_header 'Setup (Debian based)' - # Puppetlabs packaging: - # - xenial: puppet4 only if [ "${MANAGE_REPOS}" == "true" ] ; then - echo "deb ${NODEPOOL_PUPPETLABS_MIRROR} `lsb_release -s -c` PC1" | $SUDO tee /etc/apt/sources.list.d/puppetlabs.list + if [ $PUPPET_MAJ_VERSION == 4 ]; then + local PUPPET_APT_POOL="PC1" + elif [ $PUPPET_MAJ_VERSION == 5 ]; then + local PUPPET_APT_POOL="puppet5" + fi + echo "deb ${NODEPOOL_PUPPETLABS_MIRROR} `lsb_release -s -c` ${PUPPET_APT_POOL}" | $SUDO tee /etc/apt/sources.list.d/puppetlabs.list $SUDO apt-key add files/GPG-KEY-puppetlabs $SUDO apt-key add files/GPG-KEY-ceph $SUDO apt-get update @@ -141,12 +144,17 @@ install_puppet() { fi if [ "${MANAGE_REPOS}" == "true" ] ; then + if [ $PUPPET_MAJ_VERSION == 4 ]; then + local PUPPET_YUM_SUFFIX="/el/7/PC1/x86_64/" + elif [ $PUPPET_MAJ_VERSION == 5 ]; then + local PUPPET_YUM_SUFFIX="/puppet5/el/7/x86_64/" + fi $SUDO rpm --import files/GPG-KEY-puppetlabs $SUDO rpm --import files/GPG-KEY-puppet $SUDO bash -c "cat << EOF > /etc/yum.repos.d/puppetlabs.repo [puppetlabs-products] name=Puppet Labs Products El 7 - x86_64 -baseurl=${NODEPOOL_PUPPETLABS_MIRROR}/el/7/PC1/x86_64/ +baseurl=${NODEPOOL_PUPPETLABS_MIRROR}${PUPPET_YUM_SUFFIX} gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-puppetlabs file:///etc/pki/rpm-gpg/GPG-KEY-puppet enabled=1