I haven''t seen a way to do this, because puppet''s
configuration has limited
datatypes.
To do something similar, I encoded the same data in strings.
I used this snippet in my manifest:
sources => ["key1/host1:1234", "key2/host2:1234"]
And this snippet in my template:
<%# syntax is "<name>/<source>" %>
<% sources.each do |source| -%>
data_source <%= source.split("/")[0] %> <%=
source.split("/")[1] %>
<% end -%>
-- Philip
On Tue, Apr 7, 2009 at 3:30 AM, Craig Dunn <lists@codenation.net> wrote:
>
>
> I''m trying to nest arrays within puppet to use in an ERB
template... is
> this something thats supported in puppet.
>
> Im defining my variable as:
>
> $var = [ [ foox, fooy ], [ barx, bary ] ]
>
> Within my erb template, I''m doing:
>
> var.each { |x,y|
> %>
> X: <%= x %>
> Y: <%= y %>
> <%
> }
> %>
>
> This seems to work when I test it with a simple Ruby script, but when my
> ERB template gets it from puppet it seems to have flattened the array,
> any way to stop this from happening?
>
> Cheers
> Craig
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---