From 09e35c233bd6fc07b431bdd6905c2ddd37bae457 Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Mon, 7 May 2012 17:04:40 -0400 Subject: [PATCH] Rotate puppet cron job log file. Fixes bug 966314. Moves the puppet cron job log file from /tmp to /var/log and adds it to logrotate. Change-Id: Id3e218a3a2bf97c5e1f07cb40c39b5a795164888 --- manifests/site.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/site.pp b/manifests/site.pp index 98b88d6a1b..cd54ae940a 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1,12 +1,18 @@ import "openstack" class openstack_cron { + include logrotate cron { "updatepuppet": user => root, minute => "*/15", - command => 'apt-get update >/dev/null 2>&1 ; sleep $((RANDOM\%600)) && cd /root/openstack-ci-puppet && /usr/bin/git pull -q && puppet apply -l /tmp/manifest.log --modulepath=/root/openstack-ci-puppet/modules manifests/site.pp', + command => 'apt-get update >/dev/null 2>&1 ; sleep $((RANDOM\%600)) && cd /root/openstack-ci-puppet && /usr/bin/git pull -q && puppet apply -l /var/log/manifest.log --modulepath=/root/openstack-ci-puppet/modules manifests/site.pp', environment => "PATH=/var/lib/gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin", } + logrotate::file { 'updatepuppet': + log => '/var/log/manifest.log', + options => ['compress', 'delaycompress', 'missingok', 'rotate 7', 'daily', 'notifempty'], + require => Cron['updatepuppet'], + } } class openstack_jenkins_slave {