munin.pp 863 Bytes
Newer Older
mh's avatar
mh committed
1
2
# dispatch munin rules
class firewall::rules::munin(
mh's avatar
mh committed
3
4
5
  Array[Stdlib::IP::Address::V4] $collector = [],
  Array[Stdlib::IP::Address::V6] $collector6 = [],
  Stdlib::Port $port = 4949,
mh's avatar
mh committed
6
7
8
9
  Enum['loc','net'] $collector_source = 'net',
){
  include firewall
  if $firewall::use_nftables {
mh's avatar
mh committed
10
    if !empty($collector) {
mh's avatar
mh committed
11
12
      nftables::rule {
        'default_in-munin-ipv4':
mh's avatar
mh committed
13
          content => "ip saddr {${collector.join(',')}} tcp dport ${port} accept",
mh's avatar
mh committed
14
15
      }
    }
mh's avatar
mh committed
16
    if !empty($collector6) {
mh's avatar
mh committed
17
18
      nftables::rule {
        'default_in-munin-ipv6':
mh's avatar
mh committed
19
          content => "ip6 saddr {${collector6.join(',')}} tcp dport ${port} accept",
mh's avatar
mh committed
20
21
22
      }
    }
  } else {
mh's avatar
mh committed
23
    class{'shorewall::rules::munin':
mh's avatar
mh committed
24
      munin_port       => $port,
mh's avatar
mh committed
25
26
      munin_collector  => $collector,
      munin_collector6 => $collector6,
mh's avatar
mh committed
27
28
29
30
      collector_source => $collector_source,
    }
  }
}