summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2015-04-23 16:06:27 -0400
committerGabriel Filion <gabster@lelutin.ca>2015-04-23 16:06:27 -0400
commit29c61a62a49f042678a16331e2fd67bb7ae1ee57 (patch)
treea70dcc23b26618c295e8ef20fd46830d9dd1f933 /manifests
parent0b20e1e0fd001cb0b688c6bf6971c8e7c3f743c6 (diff)
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.
Diffstat (limited to 'manifests')
-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 }