From 300d09ca6e0bb296f7a8175e6e005cf77efca0e4 Mon Sep 17 00:00:00 2001 From: Sergii Kipot Date: Mon, 15 Jul 2019 16:04:27 +0200 Subject: [PATCH] TT#62000 Install dirmngr package before puppet run Initially dirmngr package was installed to allow running apt-key inside deployment.sh to install puppetlabs key. Then after moving puppetlabs key to local file package installation was removed. But we still need it for successful first puppet run that also uses apt-key. Otherwise there is the error: 'Could not find a suitable provider for apt_key'. Puppet also installs dirmngr package but in such case only the second puppet run will be successful so we need to install the package before the very first puppet run. Change-Id: I28edbd8c91c841074ac1b3f1eb6df16e14daa084 --- templates/scripts/includes/deployment.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index f7c20dc..94aeb1c 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -2101,6 +2101,15 @@ puppet_install_from_puppet () { chroot $TARGET apt-get -y install resolvconf libnss-myhostname + case "$DEBIAN_RELEASE" in + stretch|buster) + if [ ! -x "${TARGET}/usr/bin/dirmngr" ] ; then + echo "Installing dirmngr on Debian ${DEBIAN_RELEASE}, otherwise the first puppet run fails: 'Could not find a suitable provider for apt_key'" + chroot $TARGET apt-get -y install dirmngr + fi + ;; + esac + echo "Installing 'puppet-agent' with dependencies" cat >> ${TARGET}/etc/apt/sources.list.d/puppetlabs.list << EOF deb ${DEBIAN_URL}/puppetlabs/ ${DEBIAN_RELEASE} main puppet5 dependencies