On Thu, Sep 22, 2011 at 09:53:46AM -0400, John Morrissey wrote:
> I'm using an Apache 2 base class based on
> http://projects.puppetlabs.com/projects/1/wiki/Debian_Apache2_Recipe_Patterns.
> 
> I'd like to pass additional dependencies to the class and/or the definitions
> it contains. For example, I'd like to allow classes using this Apache base
> class to add additional require items to Service['apache2'].
> 
> I could pass the dependency list to the class, like so:
> 
> class apache2($require) {
>       service { 'apache2':
>               require => $require,
>       }
> }
> class { 'apache2':
>       require => [Package['foo'], Package['bar']],
> }
> 
> but this requires apache2 consumers to pass the entire dependency list; the
> apache2 base class can't inject its own dependencies transparently. I'd like
> the passed dependencies to be *in addition to* any dependencies the apache2
> base class demands.
> 
> Is there a sane way to do this?

I *believe* this will work:

class apache2($extra_requires) {
        service { 'apache2':
                require => [Service['foo'], $extra_requires],
        }
}
class { 'apache2':
        extra_requires => [Package['foo'], Package['bar']],
}

But I have not tested it.

-Robin

-- 
http://singinst.org/ :  Our last, best hope for a fantastic future.
Lojban (http://www.lojban.org/): The language in which "this parrot
is dead" is "ti poi spitaki cu morsi", but "this sentence is false"
is "na nei".   My personal page: http://www.digitalkingdom.org/rlp/

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