muninmaster -> hiera role, new ssh store/collect, no more plain text munin fetching...
[mirror/dsa-puppet.git] / modules / munin / manifests / master.pp
1 # munin master node
2 class munin::master {
3   package { 'munin':
4     ensure => installed
5   }
6
7   ssh::keygen { 'munin' : }
8   ssh::authorized_key_add { 'munin-async-fetcher':
9     target_user => 'munin-async',
10     key         => dig($facts, 'ssh_keys_users', 'munin', 'id_rsa.pub', 'line'),
11     command     => '/usr/share/munin/munin-async --spoolfetch',
12     from        => $base::public_addresses,
13     collect_tag => 'munin::munin-async-fetch'
14   }
15
16   file { '/etc/munin/munin.conf':
17     content => template('munin/munin.conf.erb'),
18     require => Package['munin'];
19   }
20
21   ssl::service { 'munin.debian.org':
22     notify => Exec['service apache2 reload'],
23     key    => true,
24   }
25   file { '/etc/munin/munin-conf.d':
26     ensure  => directory,
27     mode    => '0755',
28     purge   => true,
29     force   => true,
30     recurse => true,
31     source  => 'puppet:///files/empty/',
32   }
33
34   Munin::Master_per_node<<| |>>
35
36   file { '/etc/cron.d/puppet-munin-cleanup': ensure => absent; }
37
38   concat::fragment { 'puppet-crontab--munin-master':
39     target => '/etc/cron.d/puppet-crontab',
40     source => 'puppet:///modules/munin/master-cleanup-cron',
41   }
42 }