summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/target.pp10
1 files changed, 8 insertions, 2 deletions
diff --git a/manifests/target.pp b/manifests/target.pp
index f9b7e13..be6c40e 100644
--- a/manifests/target.pp
+++ b/manifests/target.pp
@@ -3,14 +3,20 @@
class nagios::target(
$parents = 'absent',
$address = $::ipaddress,
- $nagios_alias = $::hostname,
+ $nagios_alias = false,
$hostgroups = 'absent'
){
@@nagios_host { $::fqdn:
address => $address,
- alias => $nagios_alias,
use => 'generic-host',
}
+ # 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}"] { parents => $parents }