On Jun 24, 2010, at 10:55 PM, Mathijs wrote:

> Hi all,
> 
> Is it possible to override the behaviour of all instances of a
> resource from a module?
> I would like to have my "apt" module add a requirement for Exec["apt-
> get update"] to all Package resources.
> 
> putting
> Package { require => Exec["apt-get update"] }
> in the module itself won't work, since the scope of that will only be
> in the module itself.

Actually, it's pretty trivial.  Just put:
Package { require => Exec["apt-get update"] }
in the root of your manifests.  One typical place is the beginning of site.pp.

Technically, I recommend putting all your package init in a class, and 
requiring that class in Package like this:
Package { require => Class["apt-presetup"] }

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