Hi Haris,

On Thu, Feb 18, 2010 at 12:33 PM, Haris Farooque <mfha...@fleetboard.com> wrote:
> Dear members,
> Is it possible to iterate arrays ? Loops will definitely solve this, but i
> don't know how to do it in puppet.
> waiting for suggestions and comments

unluckily there is no direct loop to do this, puppets array (and hash)
handling is rather rudimentary.

but you can work on elemts of an array by using a define:

if  you have an array like:
$array=[ "entry1", "entry2" ]

you can use it like:

define dosomething {
    # you will have your array element available here as $name
    ....
}

# use the define with your array
dosomething { $array }


Hope this helps a bit. But I would like to see a way to hande arrays
and hashes a bit more comfotable.

Bye
Frederik

>
> Thanks
>
> --
> M. Haris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> 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 puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to