diff options
Diffstat (limited to 'manifests/target.pp')
-rw-r--r-- | manifests/target.pp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/manifests/target.pp b/manifests/target.pp index 82cf6a1..2036e01 100644 --- a/manifests/target.pp +++ b/manifests/target.pp @@ -2,7 +2,7 @@ class nagios::target( $parents = 'absent', $address = $::ipaddress, - $nagios_alias = $::hostname, + $nagios_alias = false, $hostgroups = 'absent', $use = 'generic-host', ){ @@ -11,15 +11,22 @@ class nagios::target( alias => $nagios_alias, use => $use, } + # Watch out with using aliases: they need to be unique throughout *all* + # resources in a given host's catalogue. + if $nagios_alias { + Nagios_host[$::fqdn]{ + alias => $nagios_alias + } + } if ($parents != 'absent') { - Nagios_host[$::fqdn] { + Nagios_host[$::fqdn]{ parents => $parents } } if ($hostgroups != 'absent') { - Nagios_host[$::fqdn] { + Nagios_host[$::fqdn]{ hostgroups => $hostgroups } } |