I'm using 3.2 without hiera backend and have never tried to iterate over a hash 
in 2.7. So you can try and report the result :) 

--
Best regards,
Sergey Arlashin

On Aug 9, 2013, at 8:16 PM, Simon Hönscheid <[email protected]> 
wrote:

> thanks, that looks great!
> does that work with 2.7.x with storedconfigs but without hiera backend?
> 
> Am Freitag, 9. August 2013 18:10:42 UTC+2 schrieb Sergey Arlashin:
> Hi Simon,
> You can use create_resources 
> http://docs.puppetlabs.com/references/latest/function.html#createresources
> 
> --
> Best regards,
> Sergey
> 
> 
> On Aug 9, 2013, at 7:47 PM, Simon Hönscheid <[email protected]> wrote:
> 
>> I have an interesting problem an I found no solution yet:
>> 
>> I want puppet to repeat an exec for every hast element I have:
>> 
>> $database_users = [ {  user                  => 'jira',
>>                                  passwort            => 'supersecure',
>>                                  userpermissions => 'LOGIN CREATEDB 
>> NOSUPERUSER NOCREATEROLE'
>>                               },     
>>                               {  user                  => 'test',
>>                                  passwort           => 'test',
>>                                  userpermissions => 'CREATEDB NOSUPERUSER 
>> NOCREATEROLE'
>>                               },
>>                             ]    
>> 
>> now i want to do something in config.pp with it, for every element. is there 
>> a solution?
>> 
>>   exec { "echo \"CREATE ROLE ${database_user[user]}  WITH 
>> ${database_user[userpermissions]} PASSWORD '${database_user[password]}';\"| 
>> psql":
>>   onlyif => "test `echo \"\\dg\" | psql| grep ${database_user[user]}|wc -l` 
>> -eq 0"
>> }
>> 
>> thanks simon
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/puppet-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to