On May 30, 2:37 pm, Ryan Bowlby <rbowlb...@gmail.com> wrote:
> Hi All,
>
> Is there a way to override the value of a parameter to a declared
> class within my base class. My nodes use a base class that
> occasionally need to be changed. Example:
>
> class "base" {
>   class { "apache":
>     mpm => "worker",
>   }
> ..other awesomeness
>
> }
>
> Then in the nodes:
>
> node "a" {
>   include base
>
> }
>
> # made up syntax
> node "specialhost" {
>   class "special" inherits base {
>     Class { "apache": mpm => "prefork" }
>   }
>
> }
>
> How do I override the mpm param within the apache declaration within
> the base class for "specialhost"? Is this possible and if not what are
> the common workarounds?


What you wrote is similar to what I would expect to work, which would
be this:

class special inherits base {
  Class['apache'] { mpm => 'prefork' }
}

node 'specialhost' {
  include 'special'
}

That's the standard syntax for subclasses overriding their parent
class's resource's parameters.  In practice, I'd put the subclass
definition in its own file in a suitable module, of course.


John

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