my_coll_list:
- mon502.local
- mon522.local
$my_colloctors = hiera_array('my_coll_list')
COLLECTORS = <%= @my_colloctors %>
Hi,
First, hiera_array function if for creating an array looking for the key in every hiera hierarchy, if the values are just on one level, you should use the hiera function.
Second, the problem here is the way erb templates print arrays, so just a matter of format.
Regards,
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ba8d7376-6c45-48d6-80a1-5e5d58af71cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi there,
Trying to figure out how to use hiera-array in my template. So, this is what I have in .yaml file:
my_coll_list:
- mon502.local
- mon522.local
and in my nodes.pp, I have this:$my_colloctors = hiera_array('my_coll_list')
then in one of my ERB templates, I using that like this:COLLECTORS = <%= @my_colloctors %>
if i understood correctly, according the Puppet documentation, using array merge lookup, I was expecting a result like this: COLLECTORS = ['mon502.local', 'mon522.local']
but what I'm getting is: COLLECTORS = mon502.localmon522.local
What am I missing here?