you can do something like this instead:
in your manifest:
$ifs = "eth0, 192.168.120.65, 255.255.255.0, 192.168.120.255, true; eth0:0,
192.168.120.66, 255.255.255.0, 192.168.120.255, true"
file {"xxx": content => template("xxx.erb")}
and in your template:
<% ifs.split(";").each do |int| -%>
<% name, ip, mask, bcast, enable = int.split(",").map{|s| s.strip} %>
name: <%= name %>
ip: <%= ip %>
mask: <%= mask %>
bcast: <%= bcast %>
enabled: <%= enable %>
<% end -%>
Ohad
On Fri, Apr 2, 2010 at 9:55 PM, Serge Dewailly <[email protected]
> wrote:
> Hi all,
>
> Is it possible to manage List of list within Puppet ?
> I'd like to use something like this :
>
> interfaces = [ [ "eth0", "192.168.120.65", "255.255.255.0",
> "192.168.120.255", "true" ], [ "eth0:0", "192.168.120.66", "255.255.255.0",
> "192.168.120.255", "true" ] ]
>
> When looping over element in a template, I'm getting elements like if it
> was one list :
>
> <% interfaces.each do |iface| -%>
> #param <%= iface %>
> <% end -%>
>
> #param eth0
> #param 192.168.120.65
> #param 255.255.255.0
> #param 192.168.120.255
> #param true
> #param eth0:0
> #param 192.168.120.66
> #param 255.255.255.0
> #param 192.168.120.255
> #param true
>
>
> Thanks for your help.
> Serge.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<puppet-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
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.