On Wednesday, September 24, 2014 3:48:23 AM UTC-5, MezcalitoSCOP grenoble
wrote:
>
> Hi Jhon,
>
> Sorry, I just remark that I completely miss your answer a long time ago.
>
> Le vendredi 9 août 2013 15:54:35 UTC+2, jcbollinger a écrit :
>
>>
>> You can divide your resource declarations among multiple classes and have
>> each node declare (only) the classes it needs. This is part of what Mason
>> was trying to tell you. Each class should be recorded in a separate file
>> anyway, so that achieves splitting up your data among multiple files. Each
>> class may contain as few or as many resource declarations as you like.
>> Also, if there is any overlap between the resources needed by different
>> nodes then you can reduce the overall volume of data by merging the common
>> bits into classes used by multiple nodes:
>>
>
> Ok I understand this example: defining zones classes files in a dedicated
> module and declaring these classes in the node definition. Its probably the
> best solution for me.
>
> But you speak about declaring classes only in nodes that need it and in my
> case their is only one node (a DNS server) that must handle all bind zones.
> So I have to declare all classes in the same node file, right?
>
>
To "declare" a class means this
include my_module::my_class
or this
class { 'my_module::my_class':
# maybe some parameters ...
}
.
You can also use the 'require' or 'contain' function in place of 'include'
when such a declaration appears within the *definition* of another class;
these two forms also have effects on class relationships. For a class to
be applied to a given node, that class must be included in the node's
catalog, and that is the main function of a class declaration such as the
examples above. The needed declaration(s) may appear directly in the node
block (if any) selected for the node, or at top scope, or in the
definitions of other classes assigned to the node, or any mix of those.
The *definitions* of the required classes do not need to appear in the same
manifest file, nor should they do. Class "definitions" are these:
class zones::website1_com {
bind::zone { 'website1.com':
expire => 604800,
minimum => 3600,
ttl => 38400,
…
records => [
'www IN A xxx.xxx.xxx.xxx'
…
]
}
}
Does that clear things up?
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/f1887fc8-262c-4a04-aeb6-0b9b2eea64a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.