From 26727a6ad879ba4df22ad8e9cbe94ca0b329599a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 13 Aug 2016 11:06:44 -0300 Subject: Log, hour and minute support at nodo::subsystem::apt --- manifests/subsystem/apt.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'manifests/subsystem') 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, } } -- cgit v1.2.3