+ false: {
+ file { '99progressbar':
+ ensure => absent,
+ path => "${apt_conf_d}/99progressbar",
+ }
+ }
+ undef: {} # do nothing
+ default: { fail('Valid values for fancy_progress are true or false') }
+ }
+
+ case $disable_keys {
+ true: {
+ file { '99unauth':
+ ensure => present,
+ content => "APT::Get::AllowUnauthenticated 1;\n",
+ path => "${apt_conf_d}/99unauth",
+ }
+ }
+ false: {
+ file { '99unauth':
+ ensure => absent,
+ path => "${apt_conf_d}/99unauth",
+ }
+ }
+ undef: { } # do nothing
+ default: { fail('Valid values for disable_keys are true or false') }
+ }
+
+ $proxy_set = $proxy_host ? {
+ undef => absent,
+ default => present
+ }
+
+ file { '01proxy':
+ ensure => $proxy_set,
+ path => "${apt_conf_d}/01proxy",
+ content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n",
+ notify => Exec['apt_update'],
+ mode => '0644',
+ owner => root,
+ group => root,
+ }
+
+ file { 'old-proxy-file':
+ ensure => absent,
+ path => "${apt_conf_d}/proxy",
+ notify => Exec['apt_update'],
+ }
+
+ # Need anchor to provide containment for dependencies.
+ anchor { 'apt::update':
+ require => Class['apt::update'],
+ }
+
+ # manage sources if present
+ if $sources != undef {
+ validate_hash($sources)
+ create_resources('apt::source', $sources)