From 29c61a62a49f042678a16331e2fd67bb7ae1ee57 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 23 Apr 2015 16:06:27 -0400 Subject: stop defining an alias by default for hosts Since the "alias" attribute is special for puppet in that it needs to be a string that's unique throughout all of the resources on a given host's catalogue, we shouldn't always define an alias unless users really want them. This alias might (and did for some ppl) create a conflict when using a class that is named the same as $::hostname. --- manifests/target.pp | 10 ++++++++-- 1 file 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 } -- cgit v1.2.3