X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Finit.pp;h=ce88c3bd83814f575399972fa573463179ad1a77;hb=3684f88372959cb8dd6eb5bce99b6a07db43f058;hp=7d243edd7b947369f0334f096a4d8f98c08b2688;hpb=a840dd8372d8a89dd0dab0f8b41ade29a77761da;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/init.pp b/manifests/init.pp index 7d243ed..ce88c3b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,14 +29,10 @@ class apt( ) { include apt::params + include apt::update validate_bool($purge_sources_list, $purge_sources_list_d) - $refresh_only_apt_update = $always_apt_update? { - true => false, - false => true, - } - if ! defined(Package['python-software-properties']) { package { 'python-software-properties': } } @@ -46,6 +42,12 @@ class apt( true => "# Repos managed by puppet.\n", } + if $always_apt_update == true { + Exec <| title=='apt update' |> { + refreshonly => false, + } + } + $root = $apt::params::root $apt_conf_d = $apt::params::apt_conf_d $sources_list_d = $apt::params::sources_list_d @@ -58,6 +60,7 @@ class apt( group => root, mode => '0644', content => $sources_list_content, + notify => Exec['apt update'], } file { 'sources.list.d': @@ -67,12 +70,7 @@ class apt( group => root, purge => $purge_sources_list_d, recurse => $purge_sources_list_d, - } - - exec { 'apt_update': - command => "${provider} update", - subscribe => [ File['sources.list'], File['sources.list.d'] ], - refreshonly => $refresh_only_apt_update, + notify => Exec['apt update'], } case $disable_keys { @@ -89,7 +87,7 @@ class apt( path => "${apt_conf_d}/99unauth", } } - undef: { } # do nothing + undef: { } # do nothing default: { fail('Valid values for disable_keys are true or false') } } @@ -97,7 +95,7 @@ class apt( file { 'configure-apt-proxy': path => "${apt_conf_d}/proxy", content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";", - notify => Exec['apt_update'], + notify => Exec['apt update'], } } }