Re: [Puppet Users] Local variables lost outside of .each loop

2017-02-01 Thread Henrik Lindberg
On 30/01/17 22:34, Martin Alfke wrote: AFAIK all variables inside a lambda are “private”: https://docs.puppet.com/puppet/latest/lang_lambdas.html#lambda-scope Correct - they are local and only visible to inner scopes in the lambda (a lambda in a lambda). If you need an iterative function to

Re: [Puppet Users] Local variables lost outside of .each loop

2017-01-31 Thread jcbollinger
On Monday, January 30, 2017 at 3:34:40 PM UTC-6, Martin Alfke wrote: > > AFAIK all variables inside a lambda are “private”: > https://docs.puppet.com/puppet/latest/lang_lambdas.html#lambda-scope > > ... and this makes sense, because Puppet variables do not change value once set. For variables

Re: [Puppet Users] Local variables lost outside of .each loop

2017-01-30 Thread Martin Alfke
AFAIK all variables inside a lambda are “private”: https://docs.puppet.com/puppet/latest/lang_lambdas.html#lambda-scope > On 30 Jan 2017, at 21:49, Justin Diana wrote: > > Hey guys, > > I'm trying to loop through a hash to set a variable and then use it outside > of the loop. For some reason

[Puppet Users] Local variables lost outside of .each loop

2017-01-30 Thread Justin Diana
Hey guys, I'm trying to loop through a hash to set a variable and then use it outside of the loop. For some reason, although my debug shows the variable is getting set to the correct value, it's NULL as soon as I move up a layer in the nested loop: $lb_info.each |$k, $v| { $myaddress