module-apt/manifests/cron/dist_upgrade.pp
intrigeri 5102b7863b Drop apt::cron::download, and turn $apt_cron_hours into a class parameter for apt::cron::dist_upgrade.
I've introduced apt::cron::download, am not using it anymore, and have
never seen anyone else submit a bug or a merge request for it. Thus,
I feel pretty confident in dropping it.

And this allows me to trivially get rid of the $apt_cron_hours global
variable noticed by LeLutin in #13.
2016-06-29 15:59:20 +00:00

48 lines
1.1 KiB
Puppet

class apt::cron::dist_upgrade (
$cron_hours = '',
) {
package { 'cron-apt': ensure => installed }
case $cron_hours {
'': {}
default: {
# cron-apt defaults to run every night at 4 o'clock
# so we try not to run at the same time.
cron { 'apt_cron_every_N_hours':
command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt',
user => root,
hour => "${cron_hours}",
minute => 10,
require => Package['cron-apt'],
}
}
}
$action = "autoclean -y
dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-confold'
"
file { '/etc/cron-apt/action.d/3-download':
ensure => absent,
}
package { 'apt-listbugs': ensure => absent }
file { '/etc/cron-apt/action.d/4-dist-upgrade':
content => $action,
owner => root,
group => 0,
mode => '0644',
require => Package[cron-apt];
}
file { '/etc/cron-apt/config.d/MAILON':
content => "MAILON=upgrade\n",
owner => root,
group => 0,
mode => '0644',
require => Package[cron-apt];
}
}