From: daianamezdrea <46529728+daianamezdrea@users.noreply.github.com> Date: Thu, 28 May 2020 10:36:13 +0000 (+0300) Subject: Merge pull request #938 from mdklapwijk-forks/support-acng-ssl X-Git-Tag: v7.5.0~3 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2e794c96ce78485bba77183eb57544a1e7415c6f;hp=2e27931668313bef2e6a216503a82e96098eae6d;p=puppet-modules%2Fpuppetlabs-apt.git Merge pull request #938 from mdklapwijk-forks/support-acng-ssl patch-acng-ssl-support --- diff --git a/manifests/params.pp b/manifests/params.pp index b0c367c..149e4c9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -54,11 +54,12 @@ class apt::params { } $proxy_defaults = { - 'ensure' => undef, - 'host' => undef, - 'port' => 8080, - 'https' => false, - 'direct' => false, + 'ensure' => undef, + 'host' => undef, + 'port' => 8080, + 'https' => false, + 'https_acng' => false, + 'direct' => false, } $purge_defaults = { diff --git a/manifests/source.pp b/manifests/source.pp index cb75635..365ba13 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -86,11 +86,19 @@ define apt::source( if ! $location { fail(translate('cannot create a source entry without specifying a location')) } + elsif ($::apt::proxy['https_acng']) and ($location =~ /(?i:^https:\/\/)/) { + $_location = regsubst($location, 'https://','http://HTTPS///') + } + else { + $_location = $location + } # Newer oses, do not need the package for HTTPS transport. $_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ] - if ($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') } + } else { + $_location = undef } $includes = merge($::apt::include_defaults, $include) @@ -113,7 +121,7 @@ define apt::source( 'includes' => $includes, 'opt_architecture' => $architecture, 'allow_unsigned' => $allow_unsigned, - 'location' => $location, + 'location' => $_location, 'release' => $_release, 'repos' => $repos, }) diff --git a/types/proxy.pp b/types/proxy.pp index 0aae395..20cbfec 100644 --- a/types/proxy.pp +++ b/types/proxy.pp @@ -17,10 +17,11 @@ # type Apt::Proxy = Struct[ { - ensure => Optional[Enum['file', 'present', 'absent']], - host => Optional[String], - port => Optional[Integer[0, 65535]], - https => Optional[Boolean], - direct => Optional[Boolean], + ensure => Optional[Enum['file', 'present', 'absent']], + host => Optional[String], + port => Optional[Integer[0, 65535]], + https => Optional[Boolean], + https_acng => Optional[Boolean], + direct => Optional[Boolean], } ]