From f5a0fce3684cc012efa60c2904647dd3ddb80f36 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Dec 2009 19:43:47 +0100 Subject: enable to set the extra_host to absent --- manifests/extra_host.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/extra_host.pp b/manifests/extra_host.pp index 3150612..8f52de0 100644 --- a/manifests/extra_host.pp +++ b/manifests/extra_host.pp @@ -2,11 +2,14 @@ # a ping serivce is automatically added define nagios::extra_host( $ensure = present, - $ip, - $nagios_alias, + $ip = 'absent', + $nagios_alias = 'absent', $use = 'generic-host', $parents = 'localhost' ) { + if $ensure == 'present' and ($ip == 'absent' or $nagios_alias == 'absent'){ + fail("You need to define \$ip and \$nagios_alias if extra_host should be present!") + } nagios::host{$name: ensure => $ensure, ip => $ip, -- cgit v1.2.3