summaryrefslogtreecommitdiff
path: root/manifests/unattended_upgrades.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/unattended_upgrades.pp')
-rw-r--r--manifests/unattended_upgrades.pp13
1 files changed, 12 insertions, 1 deletions
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
index 6cb0518..52d7542 100644
--- a/manifests/unattended_upgrades.pp
+++ b/manifests/unattended_upgrades.pp
@@ -1,5 +1,6 @@
class apt::unattended_upgrades (
$config_content = undef,
+ $config_template = 'apt/50unattended-upgrades.erb',
$mailonlyonerror = true,
$mail_recipient = 'root',
$blacklisted_packages = [],
@@ -10,8 +11,18 @@ 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('apt/50unattended-upgrades.erb'),
+ undef => template($config_template),
default => $config_content
}