From e7ae4fb55b7afd1610a5024066896d4d63e252db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Fri, 10 May 2013 12:12:17 +0300 Subject: [PATCH] nagios: Added support for defining ip address for nagios::host. --- nagios/manifests/init.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nagios/manifests/init.pp b/nagios/manifests/init.pp index 2c7788d..51e6311 100644 --- a/nagios/manifests/init.pp +++ b/nagios/manifests/init.pp @@ -419,6 +419,8 @@ define nagios::contact::pushover($token, $group=["all"], # # $name: # Hostname of target. +# $address: +# IP address of target. Default is to use hostname. # $group: # Hostgroup name. # $osname: @@ -428,8 +430,9 @@ define nagios::contact::pushover($token, $group=["all"], # $parent: # Parent hostname. # -define nagios::host($group="NONE", $osname="NONE", $osicon="NONE", - $confdir=$nagios::common::confdir, $parent=undef) { +define nagios::host($address=undef, $group="NONE", $osname="NONE", + $osicon="NONE", $confdir=$nagios::common::confdir, + $parent=undef) { file { "${confdir}/host_${name}.cfg": ensure => present, @@ -441,6 +444,7 @@ define nagios::host($group="NONE", $osname="NONE", $osicon="NONE", } nagios_host { $name: ensure => present, + address => $address, use => "default", target => "${confdir}/host_${name}.cfg", parents => is_array($parent) ? {