On Mon, Feb 9, 2009 at 9:24 AM, nicolas <ncapp...@yahoo.fr> wrote:
>
>
>>
>>   Maybe there is something I missed about definitions. I though it was
>> a notion related to the notion of a class.
>>   I'm confused too, because your answer make me think that you
>> consider definition call like resources. Is it the case ?
>>
>>   My only request was to be able to put parameters, classes and
>> definitions calls in nodes. Here the request to have definition (call)
>>   in the external nodes.
>>
>
>  maybe the confusion comes from the fact that you must define a
> resource with the same syntax that you use to call a definition
>  x { "name" : parameters }
>  if calling a definition used a different syntax, would'nt it be
> better ?
>  Calling a definition should be equivalent to including a class.

This is the biggest mistake I see amongst people new to Puppet. A
definition isn't "called." A definition is not a function. Puppet is a
declarative language, not an imperative language. You need to make
this conceptual jump to understand the Puppet way of doing things.

Conceptually, a definition IS a resource. Let me repeat that:

Definition == Resource

That is why the syntax is the same. Definitions provide you the
ability to create composite resources that abstract away the details
of the individual resource "atoms" (file, service, etc.) that are
required to make up your defined resource.

Calling a definition absolutely should *NOT* be equivalent to
including a class, they are very different collections. Definitions
are used to abstract away collections of resources while maintaining
the ability to have multiple "instances" of the defined resource. So,
you can have multiple subversion::working-copy instances within a
single class of machine, this is a critical capability to have!
Classes are collections used to wholly define a role that a certain
node plays. So, while it may take multiple subversion::working-copy
instances to make up a webserver, you don't want multiple "webserver"
roles on a single node, that's conceptually weird.

--Paul

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