diff options
| author | varac <varacanero@zeromail.org> | 2013-02-01 11:01:23 +0100 | 
|---|---|---|
| committer | varac <varacanero@zeromail.org> | 2013-02-01 15:52:29 +0100 | 
| commit | f16a0727dce187d07389388da8b816f7b520205d (patch) | |
| tree | 1fec074afc89f298d2f17ebeffb5e0d544611df8 /manifests/apt_conf.pp | |
| parent | 6c135ea7bc2ae9951154cf5471801469e3e3d581 (diff) | |
| download | puppet-apt-f16a0727dce187d07389388da8b816f7b520205d.tar.gz puppet-apt-f16a0727dce187d07389388da8b816f7b520205d.tar.bz2 | |
Install unattended-upgrades after Exec[refresh_apt]
Before, including apt::unattended_upgrades on a host without
the unattended-upgrades package would fail on the first run,
because the module tries to install the package before apt is
finally configured.
This commit does:
- introduce the option $refresh_apt for apt::apt_conf
  (Defaults to true). Can be used to not trigger Exec['refresh_apt']
- install the unattended-upgrades package after a final
  Exec['refresh_apt']. To not run into a loop, it calls
  Apt_conf['50unattended-upgrades'] with the option
  refresh_apt => false, which is also not needed for the configuration
Diffstat (limited to 'manifests/apt_conf.pp')
| -rw-r--r-- | manifests/apt_conf.pp | 11 | 
1 files changed, 9 insertions, 2 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'], +    } +  } +  } | 
