From b38f92b8ac82a4e80d65fd7f364a5087adf1718b Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 1 Jul 2014 10:01:25 -0700 Subject: [PATCH] Log bandersnatch to file Instead of cronspam, maybe we should put the output into logfiles. Change-Id: I22586011a1abd2ce7280564cb4e8b2166c7ad820 --- modules/openstack_project/manifests/static.pp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/manifests/static.pp b/modules/openstack_project/manifests/static.pp index 20f4b195d7..157d9c3ecb 100644 --- a/modules/openstack_project/manifests/static.pp +++ b/modules/openstack_project/manifests/static.pp @@ -220,10 +220,26 @@ class openstack_project::static ( source => 'puppet:///modules/openstack_project/bandersnatch.conf', } + file { '/var/log/bandersnatch': + ensure => directory, + } + cron { 'bandersnatch': minute => '*/5', - command => 'bandersnatch mirror', + command => 'bandersnatch mirror >>/var/log/bandersnatch/mirror.log 2>&1', environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin', } + include logrotate + logrotate::file { 'bandersnatch': + log => '/var/log/bandersnatch/mirror.log', + options => [ + 'compress', + 'copytruncate', + 'missingok', + 'rotate 7', + 'daily', + 'notifempty', + ], + } }