X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Finit.pp;h=2e82502622126488f41c8f312c6fc247148c6e6c;hb=0f9327bbf4c71f346a51eb554ba116f93ff26177;hp=578d73356e5655d8f5374da85dda369da33b8600;hpb=1f7cff57059c768ea0b33fd7cd13dbc50518ba51;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) + } }