From: Bruno Travouillon Date: Tue, 7 Nov 2017 23:24:37 +0000 (+0100) Subject: Install apt-transport-https if needed X-Git-Tag: 4.4.1~7^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3292e507f58c53318912c01e2f29c25709cebe2f;p=puppet-modules%2Fpuppetlabs-apt.git Install apt-transport-https if needed Without this package, the module fails to update a repository with a location using the https method. This extends to Debian stretch, Ubuntu trusty and xenial. https support has been moved into the apt package for future releases of these distibutions, thus this change won't need to be updated. --- diff --git a/manifests/source.pp b/manifests/source.pp index 3e6d0cb..7ce7597 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -29,10 +29,13 @@ define apt::source( $_release = $release } + # Some releases do not support https transport with default installation + $_transport_https_releases = [ 'jessie', 'stretch', 'trusty', 'xenial' ] + if $ensure == 'present' { if ! $location { fail('cannot create a source entry without specifying a location') - } elsif $_release == 'jessie' { + } elsif $_release in $_transport_https_releases { $method = split($location, '[:\/]+')[0] if $method == 'https' { ensure_packages('apt-transport-https')