+ validate_hash($proxy)
+ if $proxy['ensure'] {
+ validate_re($proxy['ensure'], ['file', 'present', 'absent'])
+ }
+ 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)
+ validate_hash($pins)
+
+ 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'),
+ }
+ }
+
+ $sources_list_content = $_purge['sources.list'] ? {
+ true => "# Repos managed by puppet.\n",
+ default => undef,
+ }
+
+ $preferences_ensure = $_purge['preferences'] ? {
+ true => absent,
+ default => file,
+ }
+
+ if $_update['frequency'] == 'always' {