X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fsource.pp;h=96c174c05e2539e25066198f3a931e36ac22e6af;hb=a8250aecfe56d56d1db99a81a71f18c8b28ae36e;hp=ea24cbfe442bda3b106571e8222e8f8ba920e872;hpb=396036892d81a10afb59a0cea287e620a60f7555;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/source.pp b/manifests/source.pp index ea24cbf..96c174c 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -1,26 +1,27 @@ # source.pp # add an apt source define apt::source( - $comment = $name, - $ensure = present, - $location = '', - $release = $::lsbdistcodename, - $repos = 'main', - $include_src = false, - $include_deb = true, - $key = undef, - $pin = false, - $architecture = undef, - $trusted_source = false, + $comment = $name, + $ensure = present, + $location = '', + $release = $::apt::xfacts['lsbdistcodename'], + $repos = 'main', + $include = {}, + $key = undef, + $pin = false, + $architecture = undef, + $allow_unsigned = false, ) { - validate_string($architecture, $comment, $location, $release, $repos) - validate_bool($trusted_source, $include_src, $include_deb) + validate_string($architecture, $comment, $location, $repos) + validate_bool($allow_unsigned) + validate_hash($include) - if ! $release { + unless $release { fail('lsbdistcodename fact not available: release parameter required') } $_before = Apt::Setting["list-${title}"] + $_include = merge($::apt::include_defaults, $include) if $key { if is_hash($key) { @@ -30,6 +31,7 @@ define apt::source( $_key = merge($::apt::source_key_defaults, $key) } else { validate_string($key) + $_key = $key } } @@ -64,9 +66,9 @@ define apt::source( before => $_before, } } else { - apt::key { "Add key: ${key} from Apt::Source ${title}": + apt::key { "Add key: ${_key} from Apt::Source ${title}": ensure => present, - id => $key, + id => $_key, before => $_before, } }