On Jan 7, 2011, at 11:22 AM, Jeff McCune wrote:

> On Fri, Jan 7, 2011 at 2:47 AM, luke.bigum <luke.bi...@fasthosts.co.uk> wrote:
> Hi list,
> 
> Reading the thread "can a class require an other class?" it's been
> mentioned that perhaps one way forward for the Puppet language is to
> phase out the include keyword in favour of parametrised classes. I'm
> thinking of my Puppet and the several levels of include chaining I use
> and I'm wondering how on earth that'd be possible. Maybe I'm designing
> my modules very differently to other people?
> 
> I'll throw you an edited example from my environment and if the people
> who favour parametrised classes over includes could show me their
> alternatives that would be much appreciated. I haven't mentioned
> resources because the class names are pretty self explanatory - each
> class handles any package, service and config files related to it's
> name:
> 
> node 'somenode' {
>  include puppetmaster
> }
> 
> class puppetmaster {
>  include common
>  include puppet
>  include ldap_auth
>  include iptables::disabled
>  include httpd::ssl
>  include ruby-enterprise::passenger
> }
> 
> class ruby-enterprise::passenger {
>  include common
>  include httpd
>  include ruby-enterprise
> }
> 
> class httpd::ssl {
>  include httpd
> }
> 
> The issue I'm trying to address is the current problem with scoping.  
> Considering class common, it will be nested inside of the puppetmaster OR the 
> ruby-enterprise::passenger class and it's not clear which one.  Behavior can 
> change depending on which if variables or resource defaults are being 
> referenced outside the scope of class common.

I guess I'm really confused about how the language works.  My understanding is 
that "common" isn't nested inside of either class and just sits in he global 
namespace.  Can you give me an example of code that shows it in either class?

-- 
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