Re: [Puppet Users] Variable Scoping: What do you want?

Matt
2010-06-30T08:57:41Z

On 29 June 2010 17:22, Luke Kanies <luke@puppetlabs.com>
wrote:
> Hi all,
>
> Given the number of threads on variable scoping recently, it''s
pretty clear
> we need to change how it works.  Markus has a lot of this redone in his
> futures branch, and I''m asking him to fully describe what the
results will
> be when that''s merged, but my guess is that there are different
expectations
> for what people want to see.
>
> So, my question is, what behaviour changes would you like to see in how
> variable scoping works?  How would you like the edge cases that are
> currently hurting you to behave?
>

I''d like to see the ability to reference and change variables from
other classes.

class httpd { $monitor::services += ''httpd1'' }
class nginx { $monitor::services += ''nginx'' }

And if $monitor::services doesn''t exist then it''s just created
with
one of the above rather than having to specify $monitor::services = []

Or use the new staging feature for ordering where I could do:

stage 1 includes class monitor { $monitor::services = [] }
stage 2 includes class httpd, nginx as above

Concerning nodes, it would be nice to see those variables declared in
an inherited node be used in a child node without specify the same
classes that are in the inherited node.

Matt