On 01/05/2012 02:36 PM, Walter Heck wrote: > That's the fun part: the $distribution parameter that the define > recieves is different the second time, so it would create the files in > a different location. Normally we could solve this by making the $name > unique, but since that is what is used to make the array magic happen, > I cannot go and make that $name unique, can I?
Ah, now that problem does ring a bell or two. What I've done in the past is this: 1. create a copy of the array 2. mutilate this copy using regsubst(), i.e. uniquify the names (this will typically involve $name from the calling scope) 3. make your looping define retrieve the original array entries (by another use of regsubst() I believe) It's ugly and probably not performant, but it has worked before... ;/ HTH, Felix -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.