summaryrefslogtreecommitdiff
path: root/manifests/host/cgi.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/host/cgi.pp')
-rw-r--r--manifests/host/cgi.pp19
1 files changed, 15 insertions, 4 deletions
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 0c11d32..1c0072d 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -1,15 +1,26 @@
-class munin::host::cgi {
-
+class munin::host::cgi(
+ $owner = 'os_default'
+) {
case $::operatingsystem {
debian,ubuntu: {
- $apache_user = 'www-data'
$document_root = '/var/www/munin'
}
default: {
- $apache_user = 'apache'
$document_root = '/var/www/html/munin'
}
}
+ if $owner == 'os_default' {
+ case $::operatingsystem {
+ debian,ubuntu: {
+ $apache_user = 'www-data'
+ }
+ default: {
+ $apache_user = 'apache'
+ }
+ }
+ } else {
+ $apache_user = $owner
+ }
exec{'set_modes_for_cgi':
command => "chgrp ${apache_user} /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find ${document_root}/* -maxdepth 1 -type d -exec chgrp -R ${apache_user} {} \; && find ${document_root}/* -maxdepth 1 -type d -exec chmod -R g+w {} \;",