diff options
author | LeLutin <gabster@lelutin.ca> | 2016-06-29 19:32:57 +0000 |
---|---|---|
committer | LeLutin <gabster@lelutin.ca> | 2016-06-29 19:32:57 +0000 |
commit | 05c2603e5e63a978122b0ae10b89c720ea3d3ff0 (patch) | |
tree | 99a4b45d47621c52d51341d6eb2d8866d062a887 /manifests/cron/dist_upgrade.pp | |
parent | 5fd6c96c4202b27dd3cea335a1bebdf7b7e717ee (diff) | |
parent | c439b8a524fc8f797e98b2c5351b028cf91ce237 (diff) |
Merge branch 'bugfix/drop-obsolete-code-and-global-variable-in-apt-cron' into 'master'
Drop apt::cron::download, and turn $apt_cron_hours into a class parameter for ap…
…t::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.
(I've mistakenly marked !44 as merged)
See merge request !47
Diffstat (limited to 'manifests/cron/dist_upgrade.pp')
-rw-r--r-- | manifests/cron/dist_upgrade.pp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index 74403bb..e1a03ed 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -1,4 +1,23 @@ -class apt::cron::dist_upgrade inherits apt::cron::base { +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' |