On Wed, May 30, 2012 at 12: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? > > Thanks, > Ryan > > -- > 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. > > The way Ryan has described will allow you to override parameters FROM a base class inside of a called class. You were asking about overriding parameters from inside the BASE class to a called class? If you're getting to this level of abstraction, I'd look a data lookup mechanism like Hiera that will allow you to specify different data/parameters based on hierarchy levels of your own design. The benefit of THAT is that you don't need to use the parameterized class syntax, you can simply do 'include base' or even 'include apache' and the parameters to the apache class would always be looked-up to determine the appropriate value per-host. Does that make sense (or help)? -- Gary Larizza Professional Services Engineer Puppet Labs -- 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.