From f862889455c4c9994d0afc21a84715f4bc051a9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Antoine=20Beaupr=C3=A9?= Date: Wed, 12 Feb 2020 14:03:15 -0500 Subject: [PATCH] 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. --- manifests/source.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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') } } -- 2.32.3