On Thursday, October 6, 2016 at 8:27:40 AM UTC-5, jcbollinger wrote:
>
>
>
> On Wednesday, October 5, 2016 at 2:32:37 PM UTC-5, re-g...@wiu.edu wrote:
>>
>> I installed the puppet module saz-rsyslog from puppet forge.
>> I use The Foreman to configure nodes. The Foreman is used by puppet via 
>> configuration [master] "external_nodes" "/etc/puppet/node.rb"
>>
>> Since the saz-rsyslog module install, I have been receiving the following 
>> error off and on (not consistently) across many nodes on a puppet update 
>> (i.e. puppet agent -t):
>>
>> "Could not retrieve catalog from remote server: Error 400 on SERVER: 
>> Duplicate declaration: Class[Rsyslog] is already declared; cannot redeclare 
>> on node <node-name>"
>>
>>
>
> It seems highly unlikely that merely installing the module on the master 
> would cause any catalog compilations to fail, and certainly the error 
> message indicates that there are some declarations of its classes in play.  
> It is not the mere presence of the module, but rather the declarations of 
> one or more classes in it that is causing you trouble.
>
>  
>
>>
>> My nodes are CentOS 5,6,7; and any various number of the nodes may 
>> experience this issue, but not all of them at the same time.
>>
>> One day I will see dozens of server with this error, and other nodes not 
>> having this issue. This may go on for days if I do not touch The Foreman.
>> I'll make some changes to host configuration for puppet module class 
>> parameters in The Foreman - never the saz-rsyslog module though..
>> After the changes, half or more of the servers having issue (not all) 
>> will magically have no problems.
>> However, more nodes that did not have issues before, will now experience 
>> this issue.
>>
>> Also, this change of events is not directly related to The Foreman host 
>> configuration changes.
>> I can simply perform a puppet module upgrade to a unrelated module (e.g. 
>> mine-yumconfig). After upgrading the unrelated module, again many nodes 
>> with this issue will now have it resolved, and different ones not 
>> experiencing the issue before will now begin experiencing it.
>>
>>
>> The only clue I have is from this posting: 
>> http://grokbase.com/t/gg/puppet-users/165h0exgez/duplicate-resource-declaration-error
>> "... If you do not see the error on every run then it is modulated by 
>> something that varies between runs. That could be almost anything: 
>> manifests, data, results of function calls, node facts, or ENC output. ..."
>>
>>
>> Can anyone help me understand this issue, or help me get it resolved 
>> permanently?
>>
>> When I search for answers, all I see are "You have written a duplicate 
>> class in your module."
>>
>
>
> Any such claim is at best misleading.  The problem is not that you or 
> anyone has written a duplicate class, it's that the class in question has 
> been *declared* more than once, and at least one of those declarations 
> uses the resource-like style.  In considering that, you should be aware 
> that:
>
>    - a declaration in resource-like style can include one emitted by your 
>    ENC (part of Foreman) if it uses the form that specifies class parameters 
>    explicitly, and
>    - when one class inherits from another, any declaration of the derived 
>    class comprises an implicit declaration of its base class.  Furthermore,
>    - when class inheritance is involved, the docs 
>    
> <https://docs.puppet.com/puppet/4.7/reference/lang_classes.html#inheritance> 
>    specify that any parameters of the base class must either take their 
>    default values or have their values supplied by automatic external data 
>    lookup.  In practice, that's too weak -- a separate resource-like 
>    declaration of the base class can cause trouble even if it specifies no 
>    parameter values.
>    
> I talked up class inheritance because I've examined the manifests of the 
> latest version of the module, and there are indeed a few cases of class 
> inheritance that could be feeding your problem.  There are also cases of 
> ordinary declaration of class ::rsyslog by other classes in that module.  
> The bottom line is that you need to follow the advice from the docs with 
> respect to class ::rsyslog by avoiding declaring it via the resource-like 
> style, including preventing your ENC from doing so.  Any non-default 
> parameters must be provided via automated data binding.  I'm afraid I'm not 
> knowledgeable enough about The Foreman to tell you how to handle that end, 
> however.
>
>
> John
>
>
I understand the duplicate declaration issue - I have been reading about it 
for months trying to figure out this issue that keeps popping up. I am 
trying to figure out how it is possible I am getting a duplicate class 
declaration on a widely-used and approved module I have no control over 
(that no one else has reported any similar issue as mine), when using the 
forman to simply provide the values of parameters.

Maybe The Foreman is the cause of the ::rsyslog class to be declared more 
than once? Might you suggest this possibility? But then I think, how would 
it? And why do I have this issue for hours on a server, and then at some 
magic moment the issue just disappears? Why with two of my servers sitting 
1 IP away from each other, one will have this issue, and the other will 
not? I consider that The Foreman is causing the problem, but then I should 
have the error on all hosts at the same time. The only different in the 
YAML between hosts is the IP addresses... every other puppet module 
parameter value is exactly the same.

The Foreman has parameterized class support. It allows us to manage the 
values of the puppet module parameters.
Old Screen Shots with explaination
http://projects.theforeman.org/projects/foreman/wiki/Parameterized_class_support

When using the foreman, I am not writing any files, or declaring any 
classes. Instead, I manage the values of the puppet module parameters in 
the The Foreman WebUI, which is simply logic like 'if this host fact meets 
this criteria, then this puppet module parameter is set to this value'.





 

-- 
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/38a4d992-440b-404f-b8ae-e736da06e734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to