From: Tollef Fog Heen Date: Sun, 28 Jun 2015 18:40:30 +0000 (+0200) Subject: Make varnish log rotation less noisy X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=31a3a9671cd1bc17dba562dea642c62aff3bc7ef;p=mirror%2Fdsa-puppet.git Make varnish log rotation less noisy Import varnish.logrotate from current pkg-varnish git. This makes varnishlog and varnishncsa log rotation be quiet. --- diff --git a/modules/varnish/files/varnish.logrotate b/modules/varnish/files/varnish.logrotate new file mode 100644 index 000000000..afa230ddd --- /dev/null +++ b/modules/varnish/files/varnish.logrotate @@ -0,0 +1,29 @@ +/var/log/varnish/varnish.log { + daily + rotate 7 + missingok + compress + delaycompress + missingok + postrotate + if [ -d /run/systemd/system ]; then + systemctl -q is-active varnishlog.service || exit 0 + fi + /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + endscript +} + +/var/log/varnish/varnishncsa.log { + daily + rotate 7 + missingok + compress + delaycompress + missingok + postrotate + if [ -d /run/systemd/system ]; then + systemctl -q is-active varnishncsa.service || exit 0 + fi + /usr/sbin/invoke-rc.d varnishncsa reload > /dev/null + endscript +} diff --git a/modules/varnish/manifests/init.pp b/modules/varnish/manifests/init.pp index 004711ed1..4d10c6619 100644 --- a/modules/varnish/manifests/init.pp +++ b/modules/varnish/manifests/init.pp @@ -30,5 +30,11 @@ class varnish { notify => Service['varnish'], mode => '0444', } + + file { '/etc/logrotate.d/varnish': + source => 'puppet:///modules/varnish/varnish.logrotate', + require => Package['varnish'], + mode => '0444', + } }