]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Add logrotate config for apache
authorPeter Palfrader <peter@palfrader.org>
Tue, 7 Apr 2009 23:13:57 +0000 (01:13 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 7 Apr 2009 23:13:57 +0000 (01:13 +0200)
modules/apache2/files/common/etc/logrotate.d/apache2 [new file with mode: 0644]
modules/apache2/manifests/init.pp

diff --git a/modules/apache2/files/common/etc/logrotate.d/apache2 b/modules/apache2/files/common/etc/logrotate.d/apache2
new file mode 100644 (file)
index 0000000..096c313
--- /dev/null
@@ -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
+}
index ae66345e0ab99b8a961e5bc65326a0e9c1c66ecd..9d712a0038d22b74a970ebe7458f2c4c0c0f46de 100644 (file)
@@ -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":