Re: [Puppet Users] create an array of hashes with reduce

2018-11-09 Thread Arnau
Hi Henrik, I did not answer before cause I was playing a little more with the code thanks a lot for your asnwers and your explanation. El mié., 7 nov. 2018 a las 11:37, Henrik Lindberg (< henrik.lindb...@puppet.com>) escribió: > > what am I doing wrong now? > > > Not sure - but I simplified

Re: [Puppet Users] create an array of hashes with reduce

2018-11-07 Thread Henrik Lindberg
On 2018-11-07 10:40, Arnau wrote: Hi Henrik, first of all, thanks for your answer. El mar., 6 nov. 2018 a las 20:12, Henrik Lindberg (mailto:henrik.lindb...@puppet.com>>) escribió: [...] > $dirs = ['static','media','photos'] > $proxy = $dirs.reduce([ { 'path' => '/', 'url' =>

Re: [Puppet Users] create an array of hashes with reduce

2018-11-07 Thread Arnau
Hi Henrik, first of all, thanks for your answer. El mar., 6 nov. 2018 a las 20:12, Henrik Lindberg (< henrik.lindb...@puppet.com>) escribió: [...] > > $dirs = ['static','media','photos'] > > $proxy = $dirs.reduce([ { 'path' => '/', 'url' => > > "http://localhost:${port}/; } ]) |$memo, $value| {

Re: [Puppet Users] create an array of hashes with reduce

2018-11-06 Thread Henrik Lindberg
On 2018-11-06 17:13, Arnau wrote: Hi all, I'm using puppet 5.3. I'd like to build proxy_pass array of hashes using the /reduce /puppetbuilt-in function and picking the values from a nested hash in hiera. I first played a little bit

[Puppet Users] create an array of hashes with reduce

2018-11-06 Thread Arnau
Hi all, I'm using puppet 5.3. I'd like to build proxy_pass array of hashes using the *reduce *puppet built-in function and picking the values from a nested hash in hiera. I first played a little bit with the reduce function: $dirs =