X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fsource.pp;h=981933d0c21ce4d7b1b8664fa5f47b75d038c79f;hb=65904b214d98c899f390ac6908322fc06e3aca13;hp=afbb27ae178b9620af10c5a75eb8c3c3ec61311c;hpb=630580d1ce3c609865e31598198e7c55dda9a6ef;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/source.pp b/manifests/source.pp index afbb27a..981933d 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -22,7 +22,7 @@ define apt::source( if $facts['lsbdistcodename'] { $_release = $facts['lsbdistcodename'] } else { - fail('lsbdistcodename fact not available: release parameter required') + fail(translate('lsbdistcodename fact not available: release parameter required')) } } else { $_release = $release @@ -30,7 +30,12 @@ define apt::source( if $ensure == 'present' { if ! $location { - fail('cannot create a source entry without specifying a location') + fail(translate('cannot create a source entry without specifying a location')) + } + # 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:\/\/)/ { + ensure_packages('apt-transport-https') } } @@ -39,7 +44,7 @@ define apt::source( if $key { if $key =~ Hash { unless $key['id'] { - fail('key hash must contain at least an id entry') + fail(translate('key hash must contain at least an id entry')) } $_key = merge($::apt::source_key_defaults, $key) } else { @@ -78,7 +83,7 @@ define apt::source( 'origin' => $host, } } else { - fail('Received invalid value for pin parameter') + fail(translate('Received invalid value for pin parameter')) } create_resources('apt::pin', { "${name}" => $_pin }) }