summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-06-03 22:00:01 +0200
committermh <mh@immerda.ch>2009-06-03 22:00:01 +0200
commit1a91a29e74c42acf740bfb6d0fa391674c1953bf (patch)
treee1e00360cf5ec98e12b02ce895b7d8573dedc75e
parent49e7edc75bf219bf18fa0e6bd8da016bb781696b (diff)
introduced logrotate only if we have vhosts
otherwise we get nasty logrotate errors introduced a first logrotate naming scheme. the openbsd logrotation should be integrated in that one as well.
-rw-r--r--manifests/centos.pp9
-rw-r--r--manifests/logrotate/centos.pp8
-rw-r--r--manifests/logrotate/centos/vhosts.pp10
-rw-r--r--manifests/vhost/webdir.pp3
4 files changed, 22 insertions, 8 deletions
diff --git a/manifests/centos.pp b/manifests/centos.pp
index 01d3ecb..64af2d2 100644
--- a/manifests/centos.pp
+++ b/manifests/centos.pp
@@ -35,14 +35,7 @@ class apache::centos inherits apache::package {
owner => root, group => 0, mode => 0644;
}
- # add vhost folders to logrotation
- augeas { "logrotate_httpd_vhosts":
- changes => [ 'rm /files/etc/logrotate.d/httpd/rule/file',
- 'ins file before /files/etc/logrotate.d/httpd/rule/*[1]',
- 'ins file before /files/etc/logrotate.d/httpd/rule/*[1]',
- 'set /files/etc/logrotate.d/httpd/rule/file[1] /var/log/httpd/*log',
- 'set /files/etc/logrotate.d/httpd/rule/file[2] /var/www/vhosts/*/logs/*log' ],
- }
+ include apache::logrotate::centos
apache::config::file{ 'welcome.conf': }
apache::config::file{ 'vhosts.conf': }
diff --git a/manifests/logrotate/centos.pp b/manifests/logrotate/centos.pp
new file mode 100644
index 0000000..6571ada
--- /dev/null
+++ b/manifests/logrotate/centos.pp
@@ -0,0 +1,8 @@
+class apache::logrotate::centos {
+ # add vhost folders to logrotation
+ augeas{'logrotate_httpd':
+ changes => [ 'rm /files/etc/logrotate.d/httpd/rule/file',
+ 'ins file before /files/etc/logrotate.d/httpd/rule/*[1]',
+ 'set /files/etc/logrotate.d/httpd/rule/file[1] /var/log/httpd/*log' ],
+ }
+}
diff --git a/manifests/logrotate/centos/vhosts.pp b/manifests/logrotate/centos/vhosts.pp
new file mode 100644
index 0000000..941f50d
--- /dev/null
+++ b/manifests/logrotate/centos/vhosts.pp
@@ -0,0 +1,10 @@
+class apache::logrotate::centos::vhosts inherits apache::logrotate::centos {
+ # add vhost folders to logrotation
+ Augeas['logrotate_httpd']{
+ changes => [ 'rm /files/etc/logrotate.d/httpd/rule/file',
+ 'ins file before /files/etc/logrotate.d/httpd/rule/*[1]',
+ 'ins file before /files/etc/logrotate.d/httpd/rule/*[1]',
+ 'set /files/etc/logrotate.d/httpd/rule/file[1] /var/log/httpd/*log',
+ 'set /files/etc/logrotate.d/httpd/rule/file[2] /var/www/vhosts/*/logs/*log' ],
+ }
+}
diff --git a/manifests/vhost/webdir.pp b/manifests/vhost/webdir.pp
index 91ee799..a6c6b2f 100644
--- a/manifests/vhost/webdir.pp
+++ b/manifests/vhost/webdir.pp
@@ -103,6 +103,9 @@ define apache::vhost::webdir(
ensure => directory,
owner => $real_documentroot_owner, group => $real_documentroot_group, mode => 0660;
}
+ case $operatingsystem {
+ centos: { include apache::logrotate::centos::vhosts }
+ }
file{"${real_path}/private":
ensure => directory,
owner => $real_documentroot_owner, group => $real_documentroot_group, mode => 0600;