From 2c9a0c1b629bd8a5481101af539c29cbfeb6e58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Tue, 7 May 2013 22:20:59 +0300 Subject: [PATCH] nagios: Added support for defining more than one parent host. --- nagios/manifests/init.pp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nagios/manifests/init.pp b/nagios/manifests/init.pp index 92cc6ff..cc53d95 100644 --- a/nagios/manifests/init.pp +++ b/nagios/manifests/init.pp @@ -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, } }