eaebe2f82d
The default configuration we were writing for Debian was only working for Squeeze, from Wheezy and onwards this wasn't working anymore. This has to do with the fact that we should now be using Origins-Pattern according to the unattended-upgrades docs. However, Ubuntu didn't entirely get with the program yet... This change reflects the defaults that unattended-upgrade installs on every platform we support. In order to do so the unattended-upgrades Debian archive for Squeeze, Wheezy, Lucid, Precise and Trusty were downloaded and the default /etc/apt/apt.conf.d/50unattended-upgrades checked for its content with regard to using Allow-Origins or Origins-Pattern. Fixes #277
69 lines
2 KiB
Puppet
69 lines
2 KiB
Puppet
# Class: apt::unattended_upgrades
|
|
#
|
|
# This class manages the unattended-upgrades package and related configuration
|
|
# files for ubuntu
|
|
#
|
|
# origins are the repositories to automatically upgrade included packages
|
|
# blacklist is a list of packages to not automatically upgrade
|
|
# update is how often to run "apt-get update" in days
|
|
# download is how often to run "apt-get upgrade --download-only" in days
|
|
# upgrade is how often to upgrade packages included in the origins list in days
|
|
# autoclean is how often to run "apt-get autoclean" in days
|
|
#
|
|
# information on the other options can be found in the 50unattended-upgrades
|
|
# file and in /etc/cron.daily/apt
|
|
#
|
|
class apt::unattended_upgrades (
|
|
$origins = $::apt::params::origins,
|
|
$blacklist = [],
|
|
$update = "1",
|
|
$download = "1",
|
|
$upgrade = "1",
|
|
$autoclean = "7",
|
|
$auto_fix = true,
|
|
$minimal_steps = false,
|
|
$install_on_shutdown = false,
|
|
$mail_to = "NONE",
|
|
$mail_only_on_error = false,
|
|
$remove_unused = true,
|
|
$auto_reboot = false,
|
|
$dl_limit = "NONE",
|
|
$enable = "1",
|
|
$backup_interval = "0",
|
|
$backup_level = "3",
|
|
$max_age = "0",
|
|
$min_age = "0",
|
|
$max_size = "0",
|
|
$download_delta = "0",
|
|
$verbose = "0",
|
|
) inherits ::apt::params {
|
|
|
|
validate_bool(
|
|
$auto_fix,
|
|
$minimal_steps,
|
|
$install_on_shutdown,
|
|
$mail_only_on_error,
|
|
$remove_unused,
|
|
$auto_reboot
|
|
)
|
|
validate_array($origins)
|
|
|
|
package { 'unattended-upgrades':
|
|
ensure => present,
|
|
}
|
|
|
|
File {
|
|
ensure => file,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
require => Package['unattended-upgrades'],
|
|
}
|
|
|
|
file {
|
|
'/etc/apt/apt.conf.d/50unattended-upgrades':
|
|
content => template('apt/50unattended-upgrades.erb');
|
|
'/etc/apt/apt.conf.d/10periodic':
|
|
content => template('apt/10periodic.erb');
|
|
}
|
|
}
|