From 6ce74b546e362e422e3c1bd1d4ba75195ffb64c4 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 7 Apr 2021 12:53:18 +0200 Subject: [PATCH] Fix installing puppet in Debian. This patch fixes the install of the puppet packages in Debian. Change-Id: I5674333169c8d961dbe29fc2f93bf42635cc2748 --- all-in-one.sh | 6 +++++- functions | 22 ++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/all-in-one.sh b/all-in-one.sh index 75dcb6969..c920a6788 100755 --- a/all-in-one.sh +++ b/all-in-one.sh @@ -48,9 +48,13 @@ if is_fedora; then DASHBOARD="dashboard" elif uses_debs; then print_header 'Setup (Debian based)' - sudo apt-get remove -y --purge facter puppet puppet-common sudo apt-get update sudo apt-get install -y libxml2-dev libxslt-dev zlib1g-dev ruby wget lsb-release curl apt-transport-https adduser + # Only purge puppet in Ubuntu, in Debian we use + # what the distribution provides. + if [ $(lsb_release --id -s) = "Ubuntu" ] ; then + sudo apt-get remove -y --purge facter puppet puppet-common + fi DASHBOARD="horizon" fi diff --git a/functions b/functions index e1d9c3327..cf2b126ad 100644 --- a/functions +++ b/functions @@ -194,13 +194,23 @@ install_puppet() { print_header 'Setup (Debian based)' if [ "${MANAGE_REPOS}" == "true" ] ; then PUPPET_CODENAME=$(lsb_release -s -c) - $SUDO mkdir -p /etc/apt/sources.list.d - echo "deb ${NODEPOOL_PUPPETLABS_MIRROR} ${PUPPET_CODENAME} puppet${PUPPET_MAJ_VERSION}" | $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 + DISTRIBUTION_VENDOR=$(lsb_release -s -i) + # In Debian, we use the distro packages + if [ "${DISTRIBUTION_VENDOR}" = "Ubuntu" ] ; then + $SUDO mkdir -p /etc/apt/sources.list.d + echo "deb ${NODEPOOL_PUPPETLABS_MIRROR} ${PUPPET_CODENAME} puppet${PUPPET_MAJ_VERSION}" | $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 + fi + fi + # In Debian, the distro package name is simply "puppet" + # and there's no reason to have it in a variable. + if [ "${DISTRIBUTION_VENDOR}" = "Debian" ] ; then + $SUDO apt-get install -y puppet + else + $SUDO apt-get install -y ${PUPPET_PKG} fi - $SUDO apt-get install -y ${PUPPET_PKG} elif is_fedora; then print_header 'Setup (RedHat based)' # EPEL does not work fine with RDO, we need to make sure EPEL is really disabled