diff options
Diffstat (limited to 'manifests/target.pp')
-rw-r--r-- | manifests/target.pp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/manifests/target.pp b/manifests/target.pp index fc39834..9a86c09 100644 --- a/manifests/target.pp +++ b/manifests/target.pp @@ -2,16 +2,21 @@ class nagios::target( $parents = 'absent', -) { + $address = $::ipaddress, + $nagios_alias = $::hostname, + $hostgroups = 'absent', +){ + @@nagios_host { $::fqdn: + address => $address, + alias => $nagios_alias, + use => 'generic-host', + } - @@nagios_host { $::fqdn: - address => $::ipaddress, - alias => $::hostname, - use => 'generic-host', - } - - if ($parents != 'absent') { - Nagios_host["${::fqdn}"] { parents => $parents } - } + if ($parents != 'absent') { + Nagios_host["${::fqdn}"] { parents => $parents } + } + if ($hostgroups != 'absent') { + Nagios_host["${::fqdn}"] { hostgroups => $hostgroups } + } } |