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, } }