- purge => $purge_preferences_d,
- recurse => $purge_preferences_d,
- }
-
- case $fancy_progress {
- true: {
- file { '99progressbar':
- ensure => present,
- content => 'Dpkg::Progress-Fancy "1";',
- path => "${apt_conf_d}/99progressbar",
- }
- }
- 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') }
- }
-
- case $proxy_host {
- false, '', undef: {
- file { '01proxy':
- ensure => absent,
- path => "${apt_conf_d}/01proxy",
- notify => Exec['apt_update'],
- }
- }
- default: {
- file { '01proxy':
- ensure => present,
- 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'],
+ mode => '0644',
+ purge => $_purge['preferences.d'],
+ recurse => $_purge['preferences.d'],
+ notify => Exec['apt_update'],