diff options
author | Gabriel Filion <gabster@lelutin.ca> | 2016-02-02 17:07:21 -0500 |
---|---|---|
committer | Gabriel Filion <gabster@lelutin.ca> | 2016-02-02 17:07:21 -0500 |
commit | c4a0aff2af47d48ca1b41110274ebb3879c4b758 (patch) | |
tree | 0e74e81a42221448bb362082b84cdbc7af2bffd0 | |
parent | 207218cee80ae99845cb567737f14a5eaafc136d (diff) | |
download | puppet-apt-c4a0aff2af47d48ca1b41110274ebb3879c4b758.tar.gz puppet-apt-c4a0aff2af47d48ca1b41110274ebb3879c4b758.tar.bz2 |
Manage unattended-upgrades log directory
In some situations, the log directory for unattended-upgrades might not
exist. In those cases, packages will not get upgraded!
unattended-upgrades crashes with a python backtrace because the log dir
is not present.
-rw-r--r-- | manifests/unattended_upgrades.pp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index ffb5fad..52d7542 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -11,6 +11,16 @@ class apt::unattended_upgrades ( ensure => $ensure_version } + # For some reason, this directory is sometimes absent, which causes + # unattended-upgrades to crash. + file { '/var/log/unattended-upgrades': + ensure => directory, + owner => 'root', + group => 0, + mode => '0755', + require => Package['unattended-upgrades'], + } + $file_content = $config_content ? { undef => template($config_template), default => $config_content |