On Apr 19, 2012, at 9:38 AM, R.I.Pienaar wrote: > ----- Original Message ----- >> From: "Andrew Parker" <[email protected]> >> To: [email protected] >> Sent: Thursday, April 19, 2012 5:30:29 PM >> Subject: Re: [Puppet-dev] Changes to variable scoping in Telly >> >> Absolutely. Debugging is always made fiendishly difficult when there >> is "action at a distance" stuff going on. Limiting that kind of >> interaction is why globals are frowned upon in most programming. Is >> there a lot of use of globals (topscope) other than facts (and enc >> parameters, I guess) in puppet? >> > > Today there is a lot of it going around. The bulk of modules would be > written with something like: > > class foo::install { > if $foo_version { $version = $foo_version } else { $version = "present"} > > package{"foo": ensure => $version} > } > > and then people will "configure" these modules either in site.pp with > globals or in a node with node scope variables. > > node "blah" { > $foo_version = "1.2.3" > > include foo::install > } > > This is very common, it used to be the only real option outside of using > extlookup and hiera. And there are vast amounts of code out in the real > world and on the forge built around this pattern. > > worse, you also had: > > class someother { > $foo_version = "1.2.4" > > include foo::install > } > > and so depending on the parse order of the actual include lines the outcome > might be different in the end, this being at the whim of the autoloader and > such it was a bit tricksy. > > All of this code either needs big refactors or just doesnt work with 2.7. >
Thanks for these examples, they help on lot in my understanding of common patterns (I hope at some point to go through code on the forge and try to get some more understanding). Since I'm not entirely clear on all the changes from 2.7 to 2.6, what changed to make these things stop working in 2.7? From my understanding of the 2.7 variable lookup system it seems like they should work in 2.7. > Until there is wide adoption of param classes or some data system this > will unfortunately still be the way. > > The proposed hash like syntax will make for much lighter refactoring apart > from all the other gains expressed in that ticket. > Is the main thing standing in the way of param class adoption the changes that you referenced above that are keeping people moving to 2.7? Or are they in some way inadequate (Jo mentions this in his email)? > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
