module-apt/manifests/unattended_upgrades.pp

35 lines
861 B
ObjectPascal
Raw Normal View History

class apt::unattended_upgrades (
$config_content = undef,
$config_template = 'apt/50unattended-upgrades.erb',
$mailonlyonerror = true,
$mail_recipient = 'root',
$blacklisted_packages = [],
$ensure_version = present
) {
2010-12-07 19:18:41 +01:00
package { 'unattended-upgrades':
ensure => $ensure_version
2009-10-30 23:07:12 +01:00
}
# 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
}
apt_conf { '50unattended-upgrades':
content => $file_content,
require => Package['unattended-upgrades'],
refresh_apt => false
}
}