nagios: Added support for defining more than one parent host.

This commit is contained in:
Timo Mkinen 2013-05-07 22:20:59 +03:00
parent 0b5f9681fa
commit 2c9a0c1b62

View file

@ -440,9 +440,13 @@ define nagios::host($group="NONE", $osname="NONE", $osicon="NONE",
require => File["/etc/nagios/conf.d"],
}
nagios_host { $name:
ensure => present,
use => "default",
target => "${confdir}/host_${name}.cfg"
ensure => present,
use => "default",
target => "${confdir}/host_${name}.cfg",
parents => is_array($parent) ? {
true => inline_template('<%= parent.join(",") -%>'),
false => $parent,
},
}
if $osicon != "NONE" {
@ -504,7 +508,6 @@ define nagios::host($group="NONE", $osname="NONE", $osicon="NONE",
Nagios_Host[$name] {
contact_groups => "all,${group}",
hostgroups => $group,
parents => $parent,
}
}