X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Finit.pp;h=2e82502622126488f41c8f312c6fc247148c6e6c;hb=39870ce9849d1915eeaf3137f17462bc8b2f6a62;hp=578d73356e5655d8f5374da85dda369da33b8600;hpb=fa86d8ed5052407f9279c308c2a9079599380bf8;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/init.pp b/manifests/init.pp index 578d733..2e82502 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -6,6 +6,7 @@ class apt( $sources = {}, $keys = {}, $ppas = {}, + $pins = {}, $settings = {}, ) inherits ::apt::params { @@ -45,6 +46,9 @@ class apt( $_purge = merge($::apt::purge_defaults, $purge) validate_hash($proxy) + if $proxy['ensure'] { + validate_re($proxy['ensure'], ['file', 'present', 'absent']) + } if $proxy['host'] { validate_string($proxy['host']) } @@ -63,9 +67,11 @@ class apt( validate_hash($keys) validate_hash($settings) validate_hash($ppas) + validate_hash($pins) - if $proxy['host'] { + if $_proxy['ensure'] == 'absent' or $_proxy['host'] { apt::setting { 'conf-proxy': + ensure => $_proxy['ensure'], priority => '01', content => template('apt/_conf_header.erb', 'apt/proxy.erb'), } @@ -149,4 +155,9 @@ class apt( if $settings { create_resources('apt::setting', $settings) } + + # manage pins if present + if $pins { + create_resources('apt::pin', $pins) + } }