On Tue, Mar 10, 2009 at 01:39:36PM +0100, Thomas Bellman wrote:
> 
> Keith Edmunds wrote:
> 
> > Is it possible to make a module a dependency?
> > 
> > We have a "base" module that contains packages, configurations, etc, that
> > should be processed before other modules, and I'm looking for a way of
> > enforcing a dependency on everything in the base module without having to
> > explicitly list each package, etc.
> 
> You can depend on a class:
> 
>      require => Class[thatclass],
>      before => Class[thatotherclass]
> 
> Not *exactly* a module, but probably close enough.
> 

If the class is the one that would be autoloaded from
$modulepath/$module/manifests/init.pp, then I'd say it's exactly enough
:)

Thomas, just make sure that init.pp contains a class that matches the
module name.  It's safest to put everything you want to run inside the
class declaration and include it at the right point.  If you put code in
init.pp but outside the class declaration, I think it will be evaluated
at the moment the class is autoloaded, which might not do predictable
things.

-- 
Bruce

If the universe were simple enough to be understood, we would be too
simple to understand it.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@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