X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fsource.pp;h=670b83035864108a7d28932678dc27287c394dab;hb=1db434a418d8375321a08a12964d42cec91c8bfa;hp=a95bc592f98d03749076786faae1f0932ff5da35;hpb=90f5fdbce44d5fe61a70fb2129e01785e95c3218;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/source.pp b/manifests/source.pp index a95bc59..670b830 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -29,8 +29,18 @@ define apt::source( $_release = $release } - if $ensure == 'present' and ! $location { - fail('cannot create a source entry without specifying a location') + # Some releases do not support https transport with default installation + $_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ] + + if $ensure == 'present' { + if ! $location { + fail('cannot create a source entry without specifying a location') + } elsif $_release in $_transport_https_releases { + $method = split($location, '[:\/]+')[0] + if $method == 'https' { + ensure_packages('apt-transport-https') + } + } } $includes = merge($::apt::include_defaults, $include)