36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'manifests/worker.pp', line 36
class icinga::worker (
Stdlib::Host $ca_server,
String $zone,
Hash[String, Hash] $parent_endpoints,
String $parent_zone = 'main',
Hash[String, Hash] $colocation_endpoints = {},
Hash[String, Hash] $workers = {},
Array[String] $global_zones = [],
Enum['file', 'syslog'] $logging_type = 'file',
Optional[Icinga::LogLevel] $logging_level = undef,
Boolean $run_web = false,
) {
# inject parent zone if no parent exists
$_workers = $workers.reduce({}) |$memo, $worker| { $memo + { $worker[0] => { parent => $zone } + $worker[1] } }
class { 'icinga':
ca => false,
ssh_private_key => undef,
ca_server => $ca_server,
this_zone => $zone,
zones => {
'ZoneName' => { 'endpoints' => { 'NodeName' => {} } + $colocation_endpoints, 'parent' => $parent_zone, },
$parent_zone => { 'endpoints' => $parent_endpoints, },
} + $_workers,
logging_type => $logging_type,
logging_level => $logging_level,
prepare_web => $run_web,
}
include icinga2::feature::checker
icinga2::object::zone { $global_zones:
global => true,
order => 'zz',
}
}
|