Hi

I am sure that there is some way to iterate an array and do something for 
each in.  It must be a wheel that has been invented (even if in a ruby 
function)?

I have needed to do something like this a few times now and I reckon 
someone clever has already done it :)

Using a normal bash type for loop as an example:

app::thing { 'foo':
  $config_templates = ['foo.conf', 'foo.more.conf']
}

define app::thing(
  $config_templates = '',
)  {
  if $config_templates != '' {
    for i_config in $config_templates
    do
      file { "/opt/app/thing/${name}/conf/${i_config}":
        content => template("app/${name}/conf_templates/${i_config}.erb"),
      }
    done
  }
}

Is there something in stdlib or forge to iterate an array and do 
something?  

-- 
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/-/4UT6Pg50gEcJ.
To post to this group, send email to puppet-users@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