2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'manifests/plugin/network.pp', line 2
class collectd::plugin::network (
Enum['present', 'absent'] $ensure = 'present',
Optional[Pattern[/[0-9]+/]] $timetolive = undef,
Optional[Pattern[/[0-9]+/]] $maxpacketsize = undef,
Optional[Boolean] $forward = undef,
Optional[Integer[1]] $interval = undef,
Optional[Boolean] $reportstats = undef,
Hash $listeners = {},
Hash $servers = {},
) {
include collectd
$listeners_defaults = {
'ensure' => $ensure,
}
$servers_defaults = {
'ensure' => $ensure,
}
collectd::plugin { 'network':
ensure => $ensure,
content => template('collectd/plugin/network.conf.erb'),
interval => $interval,
}
$listeners.each |String $resource, Hash $attributes| {
collectd::plugin::network::listener { $resource:
* => $listeners_defaults + $attributes,
}
}
$servers.each |String $resource, Hash $attributes| {
collectd::plugin::network::server { $resource:
* => $servers_defaults + $attributes,
}
}
}
|