diff options
-rw-r--r-- | manifests/extra_host.pp | 7 |
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, |