diff options
Diffstat (limited to 'manifests/target.pp')
-rw-r--r-- | manifests/target.pp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/manifests/target.pp b/manifests/target.pp index 675ac1a..f9b7e13 100644 --- a/manifests/target.pp +++ b/manifests/target.pp @@ -1,15 +1,22 @@ # manifests/target.pp -class nagios::target { +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 ($nagios_parents != '') { - Nagios_host["${fqdn}"] { parents => $nagios_parents } - } + if ($parents != 'absent') { + Nagios_host["${::fqdn}"] { parents => $parents } + } + if ($hostgroups != 'absent') { + Nagios_host["${::fqdn}"] { hostgroups => $hostgroups } + } } |