Merge pull request #831 from eimlav/modules-8321
authorTP Honey <tphoney@users.noreply.github.com>
Fri, 7 Dec 2018 10:04:13 +0000 (10:04 +0000)
committerGitHub <noreply@github.com>
Fri, 7 Dec 2018 10:04:13 +0000 (10:04 +0000)
(MODULES-8321) - Add manage_auth_conf parameter

manifests/source.pp
spec/defines/source_spec.rb

index 9c50f1a30dfb1a0dd75cf58e527488de92d205dc..3b0b06b3d54a29ae71f78efd98ccc245f567364b 100644 (file)
@@ -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 and $location =~ /(?i:^https:\/\/)/ {
+    if ($_release in $_transport_https_releases or $facts['lsbdistcodename'] in $_transport_https_releases) and $location =~ /(?i:^https:\/\/)/ {
       ensure_packages('apt-transport-https')
     }
   }
index 3436f559036b3744b7d372b4927ebda6501fc56d..69338ff548e868ba66d72140595bd304620fa5a6 100644 (file)
@@ -196,6 +196,29 @@ describe 'apt::source' do
     }
   end
 
+  context 'with a https location and custom release, install apt-transport-https' do
+    let :facts do
+      {
+        os: { family: 'Debian', name: 'Debian', release: { major: '8', full: '8.0' } },
+        lsbdistid: 'Debian',
+        lsbdistcodename: 'jessie',
+        osfamily: 'Debian',
+        puppetversion: Puppet.version,
+      }
+    end
+    let :params do
+      {
+        location: 'HTTPS://foo.bar',
+        allow_unsigned: false,
+        release: 'customrelease',
+      }
+    end
+
+    it {
+      is_expected.to contain_package('apt-transport-https')
+    }
+  end
+
   context 'with a https location, do not install apt-transport-https on oses not in list eg buster' do
     let :facts do
       {