On Monday, June 11, 2018 at 2:43:25 AM UTC-5, Arnau wrote:
>
> Hi,
>
> "include" shouldn't be a problem: 
>
> https://puppet.com/docs/puppet/5.3/lang_classes.html#include-like-behavior
>
>
> the problematic declariation must be one of the resource like declaration. 
> You can only declare a class in such format once.
>


More precisely, when the catalog builder evaluates a resource-like class 
declaration, it will throw a duplicate declaration error if the class has 
already been declared, no matter the syntax of prior declarations.  Thus, 
multiple resource-like declarations of the same class can coexist happily 
as long as no more than one of them is actually evaluated for any given 
node, but even a single one can cause a duplicate declaration error if an 
include-like declaration of the same class is evaluated earlier.

Because they are sensitive to evaluation order and dupication, 
resource-like class declarations should be avoided, especially across 
module boundaries.  Rely on automatic data binding instead for setting 
class parameters.  You may make an exception for module classes declaring 
other, private classes of the same module via resource-like declarations, 
as it is reasonable to suppose that you can ensure that the necessary 
constraints are satisfied in such cases.


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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8a0d0617-ff86-4f7f-b5ad-6ec2a6315d5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to