On 01/09/2011 09:11 PM, Stefan Schulte wrote:
> On Fri, Jan 07, 2011 at 09:41:39PM +0000, R.I.Pienaar wrote:
>> (forced to top post due to your html email)
>>
>> You cant avoid the scoping issues cos its broken.  You can work around them 
>> though.
>>
> 
> To be honest I always found the current scoping kind of clear (because I
> thought of include like of »open a new block/subscope and drop the class
> contents right here«. What I always considered wrong was that you can include 
> a
> class more then once and it surprised me that it works. So you state
> that the include should always happen in top (node) scope? At least the
> multiple include whould then be sane.

The thing with this is: You cannot get "sane" and "working" all at once
when taking this use case into account:

class common {
  $ssh_listen_ip = "10.0.0.1"
  include ssh_server
}

where $ssh_listen_ip is used in ssh_server. This dynamic scoping is the
only way of making classes dynamic where parameterized classes are not
used (or not available).

Putting all classes in the top scope implicitly kills dynamic scoping.
I'd estimate that lots of manifests (possibly all that aren't extlookup
based) cannot suffer the removal of dynamic scoping at this point.

The insanity this can induce is a huge problem (e.g.
http://projects.puppetlabs.com/issues/4748), as you mention, so it's
important (imho) for the puppet team to get the concept of parameterized
classes right. Once that's done, scoping may or may not be obsolete, but
at least the dynamic scoping as used in the above example could safely
go out the window.

Cheers,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to