summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nagios/manifests/server.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-09-23 14:15:46 +0200
committervarac <varacanero@zeromail.org>2013-10-18 14:10:10 +0200
commitcf9b3a637b4e348cd7c055ccb361e28d737914fd (patch)
tree48872f2f9209a278219634d132d57f62c7b11953 /puppet/modules/site_nagios/manifests/server.pp
parentc884bc04e2eb29bdaacc5c6673ed7f212dc28e88 (diff)
nagios: use hash instead of array for hosts (Bug #3909)
Puppet 2.7.19 introduced a change that don't allow resource titles to be something else that a string. from the puppet 2.7.19 changelog: Don’t allow resource titles which aren’t strings It was possible to create resources whose titles weren't strings, by using a variable containing a hash, or the result of a function which doesn't return a string. This can cause problems resolving relationships when the stringified version of the title differs between master and agent. Now we will only accept primitives, and will stringify them. That is: string, symbol, number, boolean. Arrays or nested arrays will still be flattened and used to create multiple resources. Any other value (for instance: a hash) will cause a parse error. currently, it's much easier to iterate over a hash in puppet than over an array, cause every resource you call iterating over an array would need a unique name, and you don't have this in arrays.
Diffstat (limited to 'puppet/modules/site_nagios/manifests/server.pp')
-rw-r--r--puppet/modules/site_nagios/manifests/server.pp7
1 files changed, 4 insertions, 3 deletions
diff --git a/puppet/modules/site_nagios/manifests/server.pp b/puppet/modules/site_nagios/manifests/server.pp
index a088921a..3e1ef7e7 100644
--- a/puppet/modules/site_nagios/manifests/server.pp
+++ b/puppet/modules/site_nagios/manifests/server.pp
@@ -5,9 +5,9 @@ class site_nagios::server inherits nagios::base {
stage => setup
}
- $nagios_hiera=hiera('nagios')
+ $nagios_hiera = hiera('nagios')
$nagiosadmin_pw = htpasswd_sha1($nagios_hiera['nagiosadmin_pw'])
- $hosts = $nagios_hiera['hosts']
+ $hosts = $nagios_hiera['hosts']
include nagios::defaults
include nagios::base
@@ -35,6 +35,7 @@ class site_nagios::server inherits nagios::base {
group => 'nagios',
}
- site_nagios::add_host {$hosts:}
+ create_resources ( site_nagios::add_host, $hosts )
+
include site_shorewall::monitor
}