nagios: Changed parent to global variable for nagios::target
Parents now defaults to libvirt_host (if set).
This commit is contained in:
parent
c6ab89af53
commit
1530461fe4
1 changed files with 12 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue