Redirect puppet cron output to a log file

The _ansible_ output (mostly consisting of puppet output) is now sent
to the puppet_run_all log file, but there is still quite a bit of
output from ancilary parts of the cron job that just gets sent in
email to infra-root every few minutes.  Send it to a log file.

Change-Id: I1f382b2d376cbfc2eff430c897bd3737fd585373
This commit is contained in:
James E. Blair 2016-01-06 08:15:06 -08:00
parent 8e21ec389c
commit 2bca224b7c

View File

@ -36,7 +36,7 @@ class openstack_project::puppetmaster (
monthday => $puppetmaster_update_cron_interval[day],
month => $puppetmaster_update_cron_interval[month],
weekday => $puppetmaster_update_cron_interval[weekday],
command => 'flock -n /var/run/puppet/puppet_run_all.lock bash /opt/system-config/production/run_all.sh',
command => 'flock -n /var/run/puppet/puppet_run_all.lock bash /opt/system-config/production/run_all.sh >> /var/log/puppet_run_all_cron.log 2>&1',
environment => 'PATH=/var/lib/gems/1.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
}
@ -54,6 +54,20 @@ class openstack_project::puppetmaster (
require => Cron['updatepuppetmaster'],
}
logrotate::file { 'updatepuppetmastercron':
ensure => present,
log => '/var/log/puppet_run_all_cron.log',
options => ['compress',
'copytruncate',
'delaycompress',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
require => Cron['updatepuppetmaster'],
}
cron { 'deleteoldreports':
user => 'root',
hour => '3',