X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Finit.pp;h=86e49c8f4ea48ff029e0251da34f01c39d0e5d44;hb=d81c3d9476b14892882620723a02617c344f703c;hp=0b4a0bc6267aad080422786c4dea95c0f9fffecb;hpb=b53ea1b90c8e050b1ce3008995ebfcb0ca0baf62;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/init.pp b/manifests/init.pp index 0b4a0bc..86e49c8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,5 +1,6 @@ # class apt( + $proxy = {}, $always_apt_update = false, $apt_update_frequency = 'reluctantly', $purge_sources_list = false, @@ -19,6 +20,28 @@ class apt( validate_bool($purge_sources_list, $purge_sources_list_d, $purge_preferences, $purge_preferences_d) + validate_hash($proxy) + if $proxy['host'] { + validate_string($proxy['host']) + } + if $proxy['port'] { + unless is_integer($proxy['port']) { + fail('$proxy port must be an integer') + } + } + if $proxy['https'] { + validate_bool($proxy['https']) + } + + $_proxy = merge($apt::proxy_defaults, $proxy) + + if $proxy['host'] { + apt::setting { 'conf-proxy': + priority => '01', + content => template('apt/_header.erb', 'apt/proxy.erb'), + } + } + $sources_list_content = $purge_sources_list ? { false => undef, true => "# Repos managed by puppet.\n",