summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-12-25 19:43:47 +0100
committermh <mh@immerda.ch>2009-12-25 19:43:47 +0100
commitf5a0fce3684cc012efa60c2904647dd3ddb80f36 (patch)
tree588492cb5594c53f60780c111ed578dd3855d849
parentc04458174e23b7b21f687cefdf11ac9a8aabf679 (diff)
enable to set the extra_host to absent
-rw-r--r--manifests/extra_host.pp7
1 files 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,