diff options
author | mh <mh@immerda.ch> | 2013-05-27 23:04:05 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-05-27 23:04:57 +0200 |
commit | eb8089cd99b9aacdb6af9da4704dce3a3ef7d299 (patch) | |
tree | 3235ff51e115e189e401817b326c374381001d06 /manifests | |
parent | a5ce0a9317fc5dd5228cff4c5b6d36366c17b6d5 (diff) | |
parent | 35107f366832d4084ccebc0b00e77d7866f29aed (diff) |
Merge remote-tracking branch 'githubmirror/master'
Integrate the changes in other changes I already merged.
Conflicts:
README
manifests/host/cgi.pp
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/host.pp | 5 | ||||
-rw-r--r-- | manifests/host/cgi.pp | 19 |
2 files changed, 19 insertions, 5 deletions
diff --git a/manifests/host.pp b/manifests/host.pp index 05dcb5e..007c43a 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,6 +4,7 @@ class munin::host( $cgi_graphing = false, + $cgi_owner = 'os_default', $export_tag = 'munin' ) { package {"munin": ensure => installed, } @@ -30,7 +31,9 @@ class munin::host( include munin::plugins::muninhost if $munin::host::cgi_graphing { - include munin::host::cgi + class {'munin::host::cgi': + owner => $cgi_owner, + } } # from time to time we cleanup hanging munin-runs 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 {} \;", |