summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorMicah <micah@riseup.net>2015-05-07 15:09:55 +0000
committerMicah <micah@riseup.net>2015-05-07 15:09:55 +0000
commit18e63a63f123f580ed2f4b6747e55476c2d72413 (patch)
tree5cd8b4f15b0926e785ce367bd46b8f8d9956b5c6 /manifests
parent40f247d6c7c4183d32452d9f4791821b92ac16c1 (diff)
parent29c61a62a49f042678a16331e2fd67bb7ae1ee57 (diff)
Merge branch 'no_alias_for_host' into 'master'
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. We've just hit hit limitation on a Koumbit node. The alias attribute is legitimate in terms of nagios host attributes, but the name of the attribute clashes with the special-purpose attribute for puppet. So one might argue that the native puppet types are flawed, and they would be correct! but getting those types fixed would be a pain in the ass since they haven't been maintained for quite some time. See merge request !10
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 }