]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
(maint) Fix resource ordering when apt-transport-https is needed apt-transport-https-ordering
authorRomain Tartière <romain@blogreen.org>
Thu, 17 Feb 2022 00:54:06 +0000 (14:54 -1000)
committerRomain Tartière <romain@blogreen.org>
Thu, 17 Feb 2022 00:54:06 +0000 (14:54 -1000)
On older Debian / Ubuntu releases, the apt-transport-https package is
required to download from an https:// source.  This package dependency
is ensured by ensure_packages() but no ordering is set, possibly
resulting of the resource being applied in a non-working order:

1. Setup a https:// source
2. Trigger apt update (this will fail)
3. Install apt-transport-https

Add a dependency to ensure apt-transport-https is installed when the
repositories are updated.

manifests/source.pp

index 54cfadfe14fa422694001acbbdfd524bc2829230..c178bd2e4b810139c14f23886f7102e637d51284 100644 (file)
@@ -102,6 +102,7 @@ define apt::source(
     $_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ]
     if ($facts['os']['distro']['codename'] in $_transport_https_releases) and $_location =~ /(?i:^https:\/\/)/ {
       ensure_packages('apt-transport-https')
+      Package['apt-transport-https'] -> Class['apt::update']
     }
   } else {
     $_location = undef