muninmaster -> hiera role, new ssh store/collect, no more plain text munin fetching...
[mirror/dsa-puppet.git] / modules / munin / manifests / init.pp
1 # our munin class
2 class munin {
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':
37     ensure  => link,
38     target  => '/usr/share/munin/plugins/df',
39     require => Package['munin-node'],
40     notify  => Service['munin-node'],
41   }
42
43   file { '/etc/munin/plugins/df_abs':
44     ensure  => file,
45     source  => 'puppet:///modules/munin/df-wrap',
46     mode    => '0555',
47     require => Package['munin-node'],
48     notify  => Service['munin-node'],
49   }
50
51   file { '/etc/munin/plugins/df_inode':
52     ensure  => link,
53     target  => '/usr/share/munin/plugins/df_inode',
54     require => Package['munin-node'],
55     notify  => Service['munin-node'],
56   }
57
58   @@munin::master_per_node { $::fqdn: }
59
60   package { 'munin-async':
61     ensure => installed
62   }
63   service { 'munin-async':
64     ensure  => running,
65     require => Package['munin-async'],
66   }
67   dsa_systemd::override { 'munin-async':
68     content  => @("EOF"),
69       [Service]
70       RestartSec=10
71       | EOF
72   }
73   file { '/etc/ssh/userkeys/munin-async':
74     ensure => 'absent',
75   }
76   ssh::authorized_key_collect { 'munin-async-fetcher':
77     target_user => 'munin-async',
78     collect_tag => 'munin::munin-async-fetch',
79   }
80 }