diff options
author | varac <varacanero@zeromail.org> | 2016-03-16 22:03:36 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-03-16 22:03:36 +0100 |
commit | 6c633f8606e04aad29f40a3fc0fcfdcb4b293715 (patch) | |
tree | 63d7c8a54a643cc628b9b4f7a3b941d9f508c4ad /manifests/host/cgi.pp | |
parent | 503e9296860e4d844a1ee391331996db87e0bfa6 (diff) | |
parent | 87dc315597e8ed27c2e0907615ede8a3f1521b7a (diff) |
Diffstat (limited to 'manifests/host/cgi.pp')
-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', } } |