From a03c85261ca9724f599adf09d3b4b731200b0731 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 8 Apr 2009 01:13:57 +0200 Subject: [PATCH] Add logrotate config for apache --- .../apache2/files/common/etc/logrotate.d/apache2 | 16 ++++++++++++++++ modules/apache2/manifests/init.pp | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 modules/apache2/files/common/etc/logrotate.d/apache2 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": -- 2.20.1