escaping
[puppet_munin.git] / manifests / host.pp
1 # host.pp - the master host of the munin installation
2 # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
3 # See LICENSE for the full license granted to you.
4
5 class munin::host inherits munin
6 {
7     package {"munin": ensure => installed, }
8
9     File <<| tag == 'munin' |>>
10
11     file{'/etc/munin/munin.conf.header':
12         source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/munin.conf.header",
13                     "puppet://$server/modules/site-munin/config/host/munin.conf.header.$operatingsystem",
14                     "puppet://$server/modules/site-munin/config/host/munin.conf.header",
15                     "puppet://$server/modules/munin/config/host/munin.conf.header.$operatingsystem",
16                     "puppet://$server/modules/munin/config/host/munin.conf.header" ],
17         notify => Exec['concat_/etc/munin/munin.conf'],
18         owner => root, group => 0, mode => 0644;
19     }
20
21     concatenated_file { "/etc/munin/munin.conf":
22         dir => '/var/lib/puppet/modules/munin/nodes',
23         header => "/etc/munin/munin.conf.header",
24     }
25
26     file { ["/var/log/munin-update.log", "/var/log/munin-limits.log",
27                "/var/log/munin-graph.log", "/var/log/munin-html.log"]:
28         ensure => present,
29         mode => 640, owner => munin, group => 0;
30     }
31
32     include munin::plugins::muninhost
33
34     case $operatingsystem {
35         centos: { include munin::host::cgi }
36     }
37
38   # from time to time we cleanup hanging munin-runs
39   file{'/etc/cron.d/munin_kill':
40     content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
41     owner => root, group => 0, mode => 0644;
42   }
43   if $use_shorewall {
44     include shorewall::rules::out::munin
45   }
46 }