blob: 5b0ecbb728b36f1e0c9af3707c2a9ad72d9f8b14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# Set up a munin host using CGI rendering
class munin::host::cgi(
$owner = 'os_default'
) {
case $::operatingsystem {
debian,ubuntu: {
$document_root = '/var/www/munin'
}
default: {
$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 {} \;",
refreshonly => true,
subscribe => Concat::Fragment['munin.conf.header'],
}
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',
}
}
|