summaryrefslogtreecommitdiff
path: root/manifests/host/cgi.pp
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-04-17 15:53:03 -0400
committerMicah Anderson <micah@riseup.net>2013-04-17 16:09:21 -0400
commita5ce0a9317fc5dd5228cff4c5b6d36366c17b6d5 (patch)
tree4e4156f9e205092a568ae55c0d46cb074c4ae64a /manifests/host/cgi.pp
parentfe7b3b5cc614378e9451640d1fa0e125e022b847 (diff)
setup $::operatingsystem triggered variables for the apache_user and document_root
Diffstat (limited to 'manifests/host/cgi.pp')
-rw-r--r--manifests/host/cgi.pp16
1 files changed, 14 insertions, 2 deletions
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 750c72d..0c11d32 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -1,8 +1,20 @@
class munin::host::cgi {
+
+ case $::operatingsystem {
+ debian,ubuntu: {
+ $apache_user = 'www-data'
+ $document_root = '/var/www/munin'
+ }
+ default: {
+ $apache_user = 'apache'
+ $document_root = '/var/www/html/munin'
+ }
+ }
+
exec{'set_modes_for_cgi':
- command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;',
+ 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 {} \;",
refreshonly => true,
- subscribe => Concat::Fragment['munin.conf.header'],
+ subscribe => Concat::Fragment['munin.conf.header'],
}
file{'/etc/logrotate.d/munin':