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

[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 =

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 simon.hoenscheid.pli...@gmail.com wrote: I have an interesting problem an I found no solution yet: I want

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 = $name[port] notify

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 -- Best