munin: squeeze cleanup
[mirror/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         file { '/var/log/munin':
13                 ensure => directory,
14                 owner  => root,
15                 group  => 'www-data',
16                 mode   => '0755',
17         }
18
19         file { '/etc/munin/munin-node.conf':
20                 content => template('munin/munin-node.conf.erb'),
21                 require => Package['munin-node'],
22                 notify  => Service['munin-node'],
23         }
24
25         file { '/etc/munin/plugin-conf.d/munin-node':
26                 content => template('munin/munin-node.plugin.conf.erb'),
27                 require => Package['munin-node'],
28                 notify  => Service['munin-node'],
29         }
30
31         file { '/etc/logrotate.d/munin-node':
32                 source => 'puppet:///modules/munin/logrotate',
33                 require => Package['munin-node'],
34         }
35
36         file { [ '/etc/munin/plugins/df', '/etc/munin/plugins/df_abs', '/etc/munin/plugins/df_inode' ]:
37                 source => 'puppet:///modules/munin/df-wrap',
38                 mode    => '0555',
39                 require => Package['munin-node'],
40                 notify  => Service['munin-node'],
41         }
42
43         @ferm::rule { 'dsa-munin-v4':
44                 description     => 'Allow munin from munin master',
45                 rule            => 'proto tcp mod state state (NEW) dport (munin) @subchain \'munin\' { saddr ($HOST_MUNIN_V4 $HOST_NAGIOS_V4) ACCEPT; }',
46                 notarule        => true,
47         }
48
49         @ferm::rule { 'dsa-munin-v6':
50                 description     => 'Allow munin from munin master',
51                 domain          => 'ip6',
52                 rule            => 'proto tcp mod state state (NEW) dport (munin) @subchain \'munin\' { saddr ($HOST_MUNIN_V6 $HOST_NAGIOS_V6) ACCEPT; }',
53                 notarule        => true,
54         }
55
56         @@munin::master-per-node {
57                 $::fqdn:
58                         ipaddress   => $::ipaddress,
59                         munin_async => $::munin_async,
60                         ;
61         }
62
63         #if $::munin_async and str2bool($::munin_async) == true {
64         #       file { '/etc/ssh/userkeys/munin-async':
65         #               source => 'puppet:///modules/munin/munin-async-authkeys',
66         #       }
67         #} else {
68         #       file { '/etc/ssh/userkeys/munin-async':
69         #               ensure => 'absent',
70         #       }
71         #}
72         package { 'munin-async':
73                 ensure => installed
74         }
75         file { '/etc/ssh/userkeys/munin-async':
76                 source => 'puppet:///modules/munin/munin-async-authkeys',
77         }
78 }