On Thursday, October 11, 2012 2:02:31 PM UTC-5, Nishant Jain wrote:
>
> Thanks Everybody, I got it working, but am still not able to read the 
> array using hiera. It always read the last element of the array.
> For example in the following global.yaml file:-
> ---
>  users:
>    - 'seventeen'
>    - 'eighteen'
>
>
> when i write hiera('users') and print it as a content it a file, It always 
> write eighteen in the file, instead of seventeen , eighteen.
>
>
> It always read the last value, i.e. eighteen.
>
> Any idea how I can make it read the whole array.
>


If the hiera config and data is indeed as you posted, then the problem is 
not on the reading side, but rather on the writing side.  You did not show 
how you are trying to output the result, but here's one way you can test:

$users = hiera('users')
notify { "debug user list":
  message => inline_template('<%= @users.join(",") %>')
}

Look for the result in the client-side log.  Note, too, that there is a 
'join' function in PuppetLabs's 'stdlib' add-in module.  That would be more 
convenient to use than inline_template(), but inline_template() should work 
with Puppet straight out of the box.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/RLmvDe63q5MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to