b7cd5d47d962d7c907628d74f2f028580e4f27da
[puppet_munin.git] / manifests / client.pp
1 # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
2 # See LICENSE for the full license granted to you.
3 # Adapted and improved by admin(at)immerda.ch
4
5 # configure a munin node
6 class munin::client(
7   $allow = [ '127.0.0.1' ],
8   $host = '*',
9   $port = '4949',
10   $use_ssh = false,
11   $manage_shorewall = false,
12   $shorewall_collector_source = 'net',
13   $export_tag = 'munin'
14 ) {
15   anchor { 'munin::client::installed': }
16
17   case $::operatingsystem {
18     openbsd: {
19       class { 'munin::client::openbsd':
20         before => Anchor['munin::client::installed']
21       }
22     }
23     darwin: {
24       class { 'munin::client::darwin':
25         before => Anchor['munin::client::installed']
26       }
27     }
28     debian,ubuntu: {
29       class { 'munin::client::debian':
30         before => Anchor['munin::client::installed']
31       }
32     }
33     gentoo: {
34       class { 'munin::client::gentoo':
35         before => Anchor['munin::client::installed']
36       }
37     }
38     centos: {
39       class { 'munin::client::base':
40         before => Anchor['munin::client::installed']
41       }
42     }
43     default: {
44       class { 'munin::client::base':
45         before => Anchor['munin::client::installed']
46       }
47     }
48   }
49   if $munin::client::manage_shorewall {
50     class{'shorewall::rules::munin':
51       munin_port       => $port,
52       munin_collector  => delete($allow,'127.0.0.1'),
53       collector_source => $shorewall_collector_source,
54     }
55   }
56 }