X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Finit.pp;h=03856a273bf00832ace479fe13d7704629862206;hb=2cdcd3b06dd199d400c70c1c36f508583330b428;hp=7964eb7c08a14bac398059777e2964bfa78beaa5;hpb=4d2819f7f4fd6f8f6ce0afc73422f17b5e637233;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/init.pp b/manifests/init.pp index 7964eb7..03856a2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -36,9 +36,14 @@ class apt( $purge_preferences_d = false, $update_timeout = undef, $update_tries = undef, - $sources = undef + $sources = undef, + $fancy_progress = undef ) { + if $::osfamily != 'Debian' { + fail('This module only works on Debian or derivatives like Ubuntu') + } + include apt::params include apt::update @@ -107,6 +112,24 @@ Package: bogus-package\n", 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': @@ -130,15 +153,21 @@ Package: bogus-package\n", default => present } - file { 'configure-apt-proxy': + file { '01proxy': ensure => $proxy_set, - path => "${apt_conf_d}/proxy", + 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': @@ -147,7 +176,7 @@ Package: bogus-package\n", # manage sources if present if $sources != undef { - validate_hash($sources) - create_resources('apt::source', $sources) + validate_hash($sources) + create_resources('apt::source', $sources) } }