On Thursday, October 6, 2016 at 9:04:14 AM UTC-5, re-g...@wiu.edu wrote:
>
>  
>
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.
>
>

I don't know how widely-tested that module is, but it absolutely does 
exhibit what I would consider to be some violations of best practices.  As 
a result, it is more susceptible than most to duplicate declaration 
issues.  Nevertheless, it appears that simple uses of that module (e.g., of 
its classes, only ::rsyslog is declared directly) and all uses relying 
exclusively on automated data binding for parameter values should be ok.

 

> Maybe The Foreman is the cause of the ::rsyslog class to be declared more 
> than once? Might you suggest this possibility?
>


I *did* suggest that possibility, inasmuch as I suggested that it might be 
emitting the ENC analog of resource-like class declarations for it.  That 
in itself would not be enough to produce the problem, but it is a likely 
contributor.  I don't see any reason to think that it would emit multiple 
declarations itself, but it does not need to do, because there are several 
other classes in the module that explicitly or implicitly declare class 
::rsyslog.  If any of those is also declared then there is a potential 
conflict.

 

> 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 cannot answer that in any detail, but obviously something differs over 
time and / or between servers.  There is an enormous variety of 
possibilities, both inside Puppet and / or The Foreman and outside.

 

> I consider that The Foreman is causing the problem, but then I should have 
> the error on all hosts at the same time.
>


I am by no means certain that the problem is directly related to The 
Foreman, and in no way am I suggesting that The Foreman is misbehaving.  I 
am, however, suggesting that in some cases The Foreman's ENC output is 
interacting poorly with the module.  That it is possible for that to be the 
case is a consequence of details of the module implementation.

 

> The only different in the YAML between hosts is the IP addresses... every 
> other puppet module parameter value is exactly the same.
>
>

That The Foreman is emitting a class declaration with parameters at all is 
very likely a contributing factor to the problem.  Note, however, that it 
may not be just the parameter values that make a difference.  It surely 
also matters which other classes are declared, and the *order* of the class 
declarations could also have an impact.  Again, however, I see no reason to 
attribute any of this to a flaw in The Foreman.

 

> The Foreman has parameterized class support. It allows us to manage the 
> values of the puppet module parameters.
>


Yes, and when you use that support, and it works exactly as intended, you 
open yourself up to duplicate class declaration issues.  Whether any such 
issues will actually manifest depends on many factors.

 

> 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'.
>


Even supposing that everything works exactly as designed, you don't need to 
write any of your own classes to end up with duplicate declaration issues.  
You do need to feed class parameters to Puppet in some way (any way) other 
than automated data binding, and you need additional declarations of the 
same classes, whether implicit or explicit, in other classes you declare.  
You certainly have the former, and the module you're using provides easy 
opportunities for the latter.


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/19e25a91-f516-4368-a15e-3ed924e14832%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to