From: Antoine Beaupré Date: Wed, 12 Feb 2020 19:03:15 +0000 (-0500) Subject: only consider lsbdistcodename for apt-transport-https X-Git-Tag: v7.4.0~4^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f862889455c4c9994d0afc21a84715f4bc051a9c;hp=d5884ab0608ee1d47f7ad922aa163f4721bb9038;p=puppet-modules%2Fpuppetlabs-apt.git only consider lsbdistcodename for apt-transport-https It does not matter if we have *one* older source from (say) jessie or stretch, we could still be running buster or later. The latter is more reliably indicated by the fact than by the provided "release" parameter, which is really just an arbitrary string that does not necessarily match a Debian suite, especially for third-party repositories. I have had a problem with this setting when deploying a "stretch" repository on a "buster" system because I needed to keep MongoDB running (which is gone from buster). The "stretch" line triggered this line, which conflicted with a `ensure_packages` I had elsewhere in our code base, to *remove* the `apt-transport-https` package from buster and later. An alternative implementation might prefer to remove the package unconditionnally if we run a newer release, but I figured I would keep the changes to a minimum. --- diff --git a/manifests/source.pp b/manifests/source.pp index 3b0b06b..cb75635 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -88,7 +88,7 @@ define apt::source( } # Newer oses, do not need the package for HTTPS transport. $_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ] - if ($_release in $_transport_https_releases or $facts['lsbdistcodename'] in $_transport_https_releases) and $location =~ /(?i:^https:\/\/)/ { + if ($facts['lsbdistcodename'] in $_transport_https_releases) and $location =~ /(?i:^https:\/\/)/ { ensure_packages('apt-transport-https') } }