]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/munin/manifests/init.pp
add vento.debian.org
[dsa-puppet.git] / modules / munin / manifests / init.pp
1 class munin {
2
3         package { 'munin-node':
4                 ensure => installed
5         }
6
7         service { 'munin-node':
8                 ensure  => running,
9                 require => Package['munin-node'],
10         }
11
12         $owner = $::lsbdistcodename ? {
13                 squeeze => munin,
14                 wheezy  => root
15         }
16
17         $gid = $::lsbdistcodename ? {
18                 squeeze => adm,
19                 wheezy  => 'www-data',
20         }
21
22         file { '/var/log/munin':
23                 ensure => directory,
24                 owner  => $owner,
25                 group  => $gid,
26                 mode   => '0755',
27         }
28
29         file { '/etc/munin/munin-node.conf':
30                 content => template('munin/munin-node.conf.erb'),
31                 require => Package['munin-node'],
32                 notify  => Service['munin-node'],
33         }
34
35         file { '/etc/munin/plugin-conf.d/munin-node':
36                 content => template('munin/munin-node.plugin.conf.erb'),
37                 require => Package['munin-node'],
38                 notify  => Service['munin-node'],
39         }
40
41         file { [ '/etc/munin/plugins/df', '/etc/munin/plugins/df_abs', '/etc/munin/plugins/df_inode' ]:
42                 source => 'puppet:///modules/munin/df-wrap',
43                 mode    => '0555',
44                 require => Package['munin-node'],
45                 notify  => Service['munin-node'],
46         }
47
48         @ferm::rule { 'dsa-munin-v4':
49                 description     => 'Allow munin from munin master',
50                 rule            => 'proto tcp mod state state (NEW) dport (munin) @subchain \'munin\' { saddr ($HOST_MUNIN_V4 $HOST_NAGIOS_V4) ACCEPT; }',
51                 notarule        => true,
52         }
53
54         @ferm::rule { 'dsa-munin-v6':
55                 description     => 'Allow munin from munin master',
56                 domain          => 'ip6',
57                 rule            => 'proto tcp mod state state (NEW) dport (munin) @subchain \'munin\' { saddr ($HOST_MUNIN_V6 $HOST_NAGIOS_V6) ACCEPT; }',
58                 notarule        => true,
59         }
60 }