Dimitris
2013-Apr-30 07:59 UTC
[Puppet Users] Class definitions under node default do not propagate in puppet-agents
In site.pp when i declare a class under <node ''puppetagent.*''> changes are propagated correctly. When the same class is declared under <node default> i have no effect on changes. node default { # This is where you can declare classes for all nodes. # Example: # class { ''my_class'': } class { ''hosts'': } } node ''puppetagent1.example.com'' { # Note the quotes around the name! Node names can have characters that # aren''t legal for class names, so you can''t always use bare, unquoted # strings like we do with classes. # Any resource or class declaration can go inside here. For now: } -- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-May-01 13:21 UTC
[Puppet Users] Re: Class definitions under node default do not propagate in puppet-agents
On Tuesday, April 30, 2013 2:59:35 AM UTC-5, Dimitris wrote:> > In site.pp when i declare a class under <node ''puppetagent.*''> changes are > propagated correctly. > When the same class is declared under <node default> i have no effect on > changes. > > > node default { > # This is where you can declare classes for all nodes. > # Example: > # class { ''my_class'': } > class { ''hosts'': } > } > > node ''puppetagent1.example.com'' { > > # Note the quotes around the name! Node names can have characters that > # aren''t legal for class names, so you can''t always use bare, unquoted > # strings like we do with classes. > > # Any resource or class declaration can go inside here. For now: > > } >Puppet matches each node to exactly one node block. The docs give the details of the priority system by which Puppet selects the best match from among multiple alternatives, but the relevant part here is that unless your node''s unqualified hostname is ''default'', the ''default'' block (if any) has lowest priority. If you want to chain node blocks together so that, say, node puppetagent1.example.com gets not only the declarations in its host-specific block but also those in the ''default'' node, then you can use node inheritance: node ''puppetagent1.example.com'' inherits default { # ... } Be warned, however, that node inheritance can be a bit tricky, in that people seem to be inclined to make assumptions about how it works that differ from its actual behavior. Do read the docs. Also, if you''re wise then you will not create a deep node inheritance hierarchy -- keep it to just two levels, or at most three if you''re sure you know why you need that many. 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.