- validate_bool($purge_sources_list, $purge_sources_list_d,
- $purge_preferences, $purge_preferences_d)
+ validate_hash($purge)
+ if $purge['sources.list'] {
+ validate_bool($purge['sources.list'])
+ }
+ if $purge['sources.list.d'] {
+ validate_bool($purge['sources.list.d'])
+ }
+ if $purge['preferences'] {
+ validate_bool($purge['preferences'])
+ }
+ if $purge['preferences.d'] {
+ validate_bool($purge['preferences.d'])
+ }
+
+ $_purge = merge($::apt::purge_defaults, $purge)
+
+ 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)
+
+ validate_hash($sources)
+ validate_hash($keys)
+ validate_hash($settings)
+ validate_hash($ppas)
+
+ if $proxy['host'] {
+ apt::setting { 'conf-proxy':
+ priority => '01',
+ content => template('apt/_conf_header.erb', 'apt/proxy.erb'),
+ }
+ }
+
+ $sources_list_content = $_purge['sources.list'] ? {
+ true => "# Repos managed by puppet.\n",
+ default => undef,
+ }