From 79ad433298c1646c17ccb336d4d06c3a6296ffdb Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 9 Aug 2010 18:12:29 -0400 Subject: add an $operatingsystem case to the host/cgi.pp for Debian, because the default apache group is www-data, not apache --- manifests/host/cgi.pp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'manifests') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 3039de1..45e0034 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,16 +1,27 @@ class munin::host::cgi inherits munin::host { - exec{'set_modes_for_cgi': + case $operatingsystem { + debian: { + exec{'set_modes_for_cgi': + command => 'chgrp www-data /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R www-data {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + } + default: { + 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 {} \;', refreshonly => true, subscribe => File['/etc/munin/munin.conf.header'], + } } + } - file{'/etc/logrotate.d/munin': - source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/logrotate", - "puppet://$server/modules/site-munin/config/host/logrotate.$operatingsystem", - "puppet://$server/modules/site-munin/config/host/logrotate", - "puppet://$server/modules/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/modules/munin/config/host/logrotate" ], - owner => root, group => 0, mode => 0644; - } + file{'/etc/logrotate.d/munin': + source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/logrotate", + "puppet://$server/modules/site-munin/config/host/logrotate.$operatingsystem", + "puppet://$server/modules/site-munin/config/host/logrotate", + "puppet://$server/modules/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/modules/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } -- cgit v1.2.3