diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-08-13 11:06:44 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-08-13 11:06:44 -0300 |
commit | 26727a6ad879ba4df22ad8e9cbe94ca0b329599a (patch) | |
tree | f22b15e51ad6e157233e68260fe0e8a764f4d5a9 /manifests/subsystem | |
parent | 90ea5d043339b311c98e54e0540316163129dda1 (diff) | |
download | puppet-nodo-26727a6ad879ba4df22ad8e9cbe94ca0b329599a.tar.gz puppet-nodo-26727a6ad879ba4df22ad8e9cbe94ca0b329599a.tar.bz2 |
Log, hour and minute support at nodo::subsystem::apt
Diffstat (limited to 'manifests/subsystem')
-rw-r--r-- | manifests/subsystem/apt.pp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/manifests/subsystem/apt.pp b/manifests/subsystem/apt.pp index dffd42a..7489413 100644 --- a/manifests/subsystem/apt.pp +++ b/manifests/subsystem/apt.pp @@ -1,6 +1,8 @@ class nodo::subsystem::apt( $ensure = present, $auto_upgrade = present, + $hour = 2, + $minute = 0, ) { file { '/etc/apt/sources.list': ensure => $ensure ? { @@ -13,15 +15,17 @@ class nodo::subsystem::apt( content => template("nodo/apt/${::operatingsystem}.sources.list.erb"), } + # We have /var/log/dpkg.log, so we do not need to rotate /var/log/upgrade.log + $log = ">> /var/log/upgrade.log 2>&1" $apt = '/usr/bin/apt-get' - $command = "${apt} update && ${apt} dist-upgrade -y && ${apt} autoremove -y && ${apt} clean" + $command = "${apt} update ${log} && ${apt} dist-upgrade -y ${log} && ${apt} autoremove -y ${log} && ${apt} clean ${log}" cron { 'nodo-apt-auto-upgrade': ensure => $auto_upgrade, command => $command, environment => 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', user => 'root', - hour => 2, - minute => 0, + hour => $hour, + minute => $minute, } } |