diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/apt_conf.pp | 11 | ||||
-rw-r--r-- | manifests/init.pp | 6 | ||||
-rw-r--r-- | manifests/preferences_snippet.pp | 2 | ||||
-rw-r--r-- | manifests/unattended_upgrades.pp | 8 |
4 files changed, 18 insertions, 9 deletions
diff --git a/manifests/apt_conf.pp b/manifests/apt_conf.pp index d78fb9b..f446c69 100644 --- a/manifests/apt_conf.pp +++ b/manifests/apt_conf.pp @@ -1,7 +1,8 @@ define apt::apt_conf( $ensure = 'present', $source = '', - $content = undef ) + $content = undef, + $refresh_apt = true ) { if $source == '' and $content == undef { @@ -22,7 +23,6 @@ define apt::apt_conf( owner => root, group => 0, mode => '0644', - notify => Exec['refresh_apt'], } if $source { @@ -35,4 +35,11 @@ define apt::apt_conf( content => $content, } } + + if $refresh_apt { + File["/etc/apt/apt.conf.d/${name}"] { + notify => Exec['refresh_apt'], + } + } + } diff --git a/manifests/init.pp b/manifests/init.pp index de28c23..33eac37 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -129,7 +129,11 @@ class apt( } if $custom_preferences != false { Exec['custom_keys'] { - before => File['apt_config'], + before => [ Exec[refresh_apt], File['apt_config'] ] + } + } else { + Exec['custom_keys'] { + before => Exec[refresh_apt] } } } diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 5ae748b..cbc83d2 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -13,7 +13,7 @@ define apt::preferences_snippet ( } if $ensure == 'present' { - if $custom_preferences == false { + if $apt::custom_preferences == false { fail('Trying to define a preferences_snippet with $custom_preferences set to false.') } diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 2f6c2a5..17455fe 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -2,7 +2,7 @@ class apt::unattended_upgrades { package { 'unattended-upgrades': ensure => present, - require => undef + require => Exec[refresh_apt] } apt_conf { '50unattended-upgrades': @@ -14,9 +14,7 @@ class apt::unattended_upgrades { require => Package['unattended-upgrades'], } - if $apt::custom_preferences != false { - Apt_conf['50unattended-upgrades'] { - before => File['apt_config'], - } + Apt_conf['50unattended-upgrades'] { + notify => undef } } |