From e9f80adaa87d5a6a906e406792629372ad15cc5f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 6 May 2013 17:31:14 +0200 Subject: Make the CGI owner configurable --- manifests/host.pp | 5 ++++- manifests/host/cgi.pp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 05dcb5e..0992d2b 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,6 +4,7 @@ class munin::host( $cgi_graphing = false, + $cgi_owner = 'apache', $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 4c0d0c9..6e5efcd 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,6 +1,8 @@ -class munin::host::cgi { +class munin::host::cgi( + $owner = 'apache' +) { 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 ${owner} /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 ${owner} {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;", refreshonly => true, subscribe => Concat::Fragment['munin.conf.header'], } -- cgit v1.2.3