migrate away from hiera stuff
[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(
6   $cgi_graphing = false
7 ) {
8   package {"munin": ensure => installed, }
9   include concat::setup
10
11   Concat::Fragment <<| tag == 'munin' |>>
12
13   concat::fragment{'munin.conf.header':
14     target => '/etc/munin/munin.conf',
15     source => [ "puppet:///modules/site_munin/config/host/${::fqdn}/munin.conf.header",
16                 "puppet:///modules/site_munin/config/host/munin.conf.header.${::operatingsystem}.${::lsbdistcodename}",
17                 "puppet:///modules/site_munin/config/host/munin.conf.header.${::operatingsystem}",
18                 "puppet:///modules/site_munin/config/host/munin.conf.header",
19                 "puppet:///modules/munin/config/host/munin.conf.header.${::operatingsystem}.${::lsbdistcodename}",
20                 "puppet:///modules/munin/config/host/munin.conf.header.${::operatingsystem}",
21                 "puppet:///modules/munin/config/host/munin.conf.header" ],
22     order => 05,
23   }
24
25   concat{ "/etc/munin/munin.conf":
26     owner => root, group => 0, mode => 0644;
27   }
28
29   include munin::plugins::muninhost
30
31   if $munin::host::cgi_graphing {
32     include munin::host::cgi
33   }
34
35   # from time to time we cleanup hanging munin-runs
36   file{'/etc/cron.d/munin_kill':
37     content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
38     owner => root, group => 0, mode => 0644;
39   }
40   if $munin::host::manage_shorewall {
41     include shorewall::rules::out::munin
42   }
43 }