On Fri, Jan 29, 2010 at 9:58 AM, Doug Warner <[email protected]> wrote:
> Running puppet 0.24.8, I'd like to make Puppet be indifferent/ignore
> whether a
> package is installed or not. The hangup here is that I include a class
> that
> installs the package, so I through to make a class that inherits that and
> changes ensure => undef, but this doesn't seem to work. I have something
> like
> this:
>
what you are describing below works: including an inherited class together
with its parent and expecting the resources to be overridden correctly.
I think the problem is that the default behavior for package when ensure =>
undef is for it to install the package. Changing this behavior could be an
interesting feature request.
you could use if(defined(Class['child'])) in the parent to determine if the
package resource should be declared. This is pretty hacky though, I would
consider remodeling your base class instead since this package resource does
not belong there.
-Dan
> class InstallPkg {
> package { coolpkg: ensure => latest, }
> }
>
> class InstallPkg::disabled inherits InstallPkg {
> Package['coolpkg'] { ensure => undef, }
> }
>
> node basenode {
> include InstallPkg
> }
>
> node stupid_node inherits basenode {
> include InstallPkg::disabled
> }
>
> Unfortunately it doesn't look like the ::disabled class is getting used at
> all
> (from looking at --debug).
>
> Any ideas what I'm doing wrong here?
>
> -Doug
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.