Re: [Puppet Users] looping over an hashmap in an .pp file

2013-08-12 Thread Dick Davies
+1 for create_resources. I use it on 2.7 without storeconfigs, and it doesn't involve hiera at all. I just declare $modulename::data = [ {.}] and feed that into a resource with: create_resources(resourcename, $modulename::data) One gotcha: this is a function (essentially a macro that expands

Re: [Puppet Users] looping over an hashmap in an .pp file

2013-08-09 Thread Sergey Arlashin
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 wrote: > thanks, that looks great! > does that work with 2.7.x with storedconfigs but w

Re: [Puppet Users] looping over an hashmap in an .pp file

2013-08-09 Thread Simon Hönscheid
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 > > -- > B

Re: [Puppet Users] looping over an hashmap in an .pp file

2013-08-09 Thread Sergey Arlashin
also you can use the following way to iterate over a hash: $foo = [ { "addr" => "bar", "port" => "1" }, { "addr" => "bat", "port" => "2" } ] testmod::bar {$foo:} define testmod::bar () { $var1 = $name["addr"] $var2 = $na

Re: [Puppet Users] looping over an hashmap in an .pp file

2013-08-09 Thread 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 wrote: > I have an interesting problem an I found no solution yet: > > I want puppet to repeat an exec for ev

[Puppet Users] looping over an hashmap in an .pp file

2013-08-09 Thread Simon Hönscheid
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