On Jul 5, 2010, at 7:11 AM, Thomas Bellman wrote:

On 2010-07-03, Jeff McCune wrote:

In this module, if you use the following orginization puppet will
autoload everything:

manifests/init.pp contains class apache { }
manifests/disable.pp contains class apache::disable inherits apache {}
manifests/virtualhost.pp contains define apache::virtualhost(){}

Yuck!  Forcing each class or define into its own file sucks royally.
No sane person wants their code organized like that.

If you want additional namespaces, they go in directories.
class apache::service::disable would go in manifests/service/ disable.pp

I highly recommend against using import today and in the future.

The cure is in this case worse, *much* worse, than the illness of having to do explicit imports. I'd rather have two dozen import lines in site.pp (which is what I have now) than having to split my classes and defines into
almost 200 files in two dozen directories.

Note that you can have all of the classes etc. for a given module just in that module's init.pp and autoload will still work correctly.

So you can get some benefit from autoload without going crazy.

--
Real freedom lies in wildness, not in civilization.
    -- Charles Lindbergh
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199

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