On Sep 18, 2010, at 9:56 PM, Nigel Kersten wrote:

> On Fri, Sep 17, 2010 at 4:39 PM, Nigel Kersten <[email protected]> wrote:
>> On Fri, Sep 17, 2010 at 2:20 PM, Luke Kanies <[email protected]> wrote:
> 
>>> This kind of thing would be well-supported by the ability to do something 
>>> like include defaults (and maybe variables) from one class into another - 
>>> akin to including a Module in ruby.  E.g., with this setup:
>>> 
>>> class apt {
>>>  Package { provider => apt }
>>> }
>>> 
>>> class main {
>>>  extend_with apt
>>> }
>>> 
>>> That would take all of the defaults and add them to main, as though they 
>>> were defined in main directly.
>>> 
>>> Would that provide sufficient equivalent functionality?
>> 
>> So you'd have to do this in every single class in which you defined a
>> package resource? That seems less optimal to me.
> 
> 
> And another thought along these lines... Doesn't this entirely
> preclude using other people's modules and still enforcing your own
> resource defaults for base resource types? I really don't think it's
> feasible to approach defaults in this manner.

Not at all, and in fact, quite the opposite - it converts defaults (and maybe 
some other things, including variables) into aspects that can be merged into 
multiple classes, so it becomes much easier to merge your policies into someone 
else's code.

-- 
Men will wrangle for religion; write for it; fight for it; die for it; 
anything but live for it.                       --Charles Caleb Colton
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199




-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.

Reply via email to