From: Peter Palfrader Date: Tue, 7 Apr 2009 23:13:57 +0000 (+0200) Subject: Add logrotate config for apache X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;ds=sidebyside;h=a03c85261ca9724f599adf09d3b4b731200b0731;p=mirror%2Fdsa-puppet.git Add logrotate config for apache --- diff --git a/modules/apache2/files/common/etc/logrotate.d/apache2 b/modules/apache2/files/common/etc/logrotate.d/apache2 new file mode 100644 index 000000000..096c31390 --- /dev/null +++ b/modules/apache2/files/common/etc/logrotate.d/apache2 @@ -0,0 +1,16 @@ +/var/log/apache2/*.log { + daily + datext + missingok + rotate 360 + compress + delaycompress + notifempty + create 644 root adm + sharedscripts + postrotate + if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then + /etc/init.d/apache2 reload > /dev/null + fi + endscript +} diff --git a/modules/apache2/manifests/init.pp b/modules/apache2/manifests/init.pp index ae66345e0..9d712a003 100644 --- a/modules/apache2/manifests/init.pp +++ b/modules/apache2/manifests/init.pp @@ -15,6 +15,11 @@ class apache2 { "puppet:///apache2/common/etc/apache2/sites-available/default-debian.org" ], require => Package["apache2"], notify => Exec["apache2 reload"]; + + "/etc/logroate.d/apache2": + source => [ "puppet:///apache2/per-host/$fqdn/etc/logroate.d/apache2", + "puppet:///apache2/common/etc/logroate.d/apache2" ]; + "/srv/www": mode => 755, ensure => directory; @@ -26,6 +31,10 @@ class apache2 { ensure => directory; "/srv/www/default.debian.org/htdocs/index.html": content => template("default-index.html"); + + "/var/log/apache2": + mode => 755, + ensure => directory; } exec { "apache2 reload":