nagios: Changed parent to global variable for nagios::target

Parents now defaults to libvirt_host (if set).
This commit is contained in:
Ossi Salmi 2013-07-15 20:54:52 +03:00
parent c6ab89af53
commit 1530461fe4

View file

@ -1,16 +1,14 @@
# Configure nagios target.
#
# === Parameters
#
# $parent:
# Parent hostname.
#
# === Global variables
#
# $nagios_target_group:
# Host and service group name. Defaults to $domain.
#
class nagios::target($parent=undef) {
# $nagios_target_parent:
# Parent hostname.
#
class nagios::target {
if $nagios_target_group {
$group = $nagios_target_group
@ -22,6 +20,14 @@ class nagios::target($parent=undef) {
}
}
if $nagios_target_parent {
$parent = $nagios_target_parent
} elsif $::libvirt_host {
$parent = $::libvirt_host
} else {
$parent = undef
}
@@nagios::host { $::homename:
group => $group,
osname => $::operatingsystem,