diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-01-20 18:40:04 +0000 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-01-20 18:40:04 +0000 |
commit | 23201220bf8b7b63da44747be142face0c98eb09 (patch) | |
tree | c1645f62976281a552963b1309307e0d0b6136f3 /manifests/host | |
parent | 7e03247a9e219fe8e57d544957eb06e305e69fc1 (diff) | |
parent | eaa092eb1a8f3ae19551e6e80f84d174211b5208 (diff) |
Merge branch 'merge_immerda' into 'master'
This is my attempt at merging the huge backlog of commits from immerda. I've been pretty verbose about it in redmine so I won't repeat it all here. For details, see:
https://labs.riseup.net/code/issues/4132
Diffstat (limited to 'manifests/host')
-rw-r--r-- | manifests/host/cgi.pp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 0c11d32..9951a48 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,15 +1,27 @@ -class munin::host::cgi { - +# Set up a munin host using CGI rendering +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 {} \;", @@ -18,11 +30,9 @@ class munin::host::cgi { } file{'/etc/logrotate.d/munin': - source => [ "puppet:///modules/site_munin/config/host/${::fqdn}/logrotate", - "puppet:///modules/site_munin/config/host/logrotate.${::operatingsystem}", - "puppet:///modules/site_munin/config/host/logrotate", - "puppet:///modules/munin/config/host/logrotate.${::operatingsystem}", - "puppet:///modules/munin/config/host/logrotate" ], - owner => root, group => 0, mode => 0644; + content => template("${module_name}/logrotate.conf.erb"), + owner => root, + group => 0, + mode => '0644', } } |