On Friday, October 14, 2016 at 5:08:31 PM UTC-5, re-g...@wiu.edu wrote:
>
>
>
> On Thursday, October 13, 2016 at 9:15:58 AM UTC-5, Rob Nelson wrote:
>>
>> I've worked with saz in the past and believe he would be very receptive 
>> to PRs that address this issue, as well, if RG or anyone else wanted to 
>> contribute them. That would be one of the better solutions to the problem.
>>
>> Rob Nelson
>> rnel...@gmail.com
>>
>>
>> I think I've given you a pretty good handle on the nature of the problem, 
>>> and I'm inclined to think that a solution that addresses the problem at its 
>>> root will take care of the whole suite of issues.
>>>
>>
> Lots and lots of thanks to jcbollinger.
> Here is what I have done as a result of this thread:
>
> Submitted an issue with saz-rsyslog:
> Duplicate Declaration Class[Rsyslog] with The Foreman as ENC during 
> catalog compilation #237
> https://github.com/saz/puppet-rsyslog/issues/237
>
> Posted a follow-up question to a related thread on The Foreman mail list 
> to determine if The Foreman also may be exhibiting a bug, or if the issue 
> may be my configuration:
> Duplicate declaration error.
> https://groups.google.com/d/topic/foreman-users/k0JgABtszdU/discussion   
> (my post is waiting for approval as of 22:00 GMT 10/14/2016)
>
> My current thought at this time is two points:
> 1. saz-rsyslog is written in such a way that declaring a subclass before 
> the parent class causes duplicate declaration errors - but I am told the 
> module inheritance should be addressed, and would resolve this issue.
> 2. The Foreman, under undetermined circumstances (maybe my 
> misconfiguration), will randomly declare parent classes and subclass out of 
> order - but I am told this is not an issue with puppet modules that use 
> inheritance correctly - thus there might be an underlying bug with The 
> Foreman because this error will not appear under modules' expected 
> inheritance.
>
>
This is what was posted on The Foreman mail list group:
https://groups.google.com/d/topic/foreman-users/k0JgABtszdU/discussion

> This is an issue with the format of the ENC YAML used between Foreman 
> and Puppet, and is best fixed in the module. 
> The list of classes is given as a hash/dictionary and so has no 
> particular order defined - it's down to the Puppet master/server to 
> iterate over it, and it probably does so in no particular order. It 
> isn't under Foreman's control.


I now believe this is truly the root of my problem. 

The evidence is looking at the ENC output and the Puppet-generated Catalog 
file on each of the master puppet servers.
As you can see below, the puppet-generated catalog on the secondary-master 
puppet server has put rsyslog::client before rsyslog - this causes the 
failure.
However, The Foreman ENC output is the same on both primary and secondary 
master puppet servers.

Is this correct, that the yaml file in /var/lib/puppet/yaml/node/ is 
exclusively generated by Puppet based on the ENC yaml?
If this is correct, then this is the root of the problem.

The next question is, why does Puppet assemble a catalog with classes out 
of order, when the ENC output has them in the correct order?
I have seen two answers to this question of classes getting out of order in 
the puppet catalog:
 1. one class 'cA' depends on 'cB', so puppet puts 'cB' first in the 
catalog. - but this is not the reason in my case.
 2. "... 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. ..." 
- which should be unlikely since it works on one secondary master and not 
the next secondary master, both configured exactly the same.

Is there a configuration issue causing this issue? Where would I begin 
looking for something that may be causing this puppet-catalog problem?


Running `puppet agent -t` on the client against the primary master puppet 
server is successful
Running `puppet agent -t` on the client against the secondary master puppet 
server fails with duplicate declaration


On the primary master puppet server

--The Foreman ENC output--
primary-puppet:/var/lib/puppet/yaml/foreman/server1.mydomain.example.com.yaml
...snip...
    rsyslog: 
      gnutls_package_name: false
      preserve_fqdn: true
      relp_package_name: false
      rsyslog_package_name: false
    "rsyslog::client": 
      log_local: true
      remote_type: udp
      server: rsyslog.mydomain.example.com
...snip...
--end--

--Puppet generated catalog--
primary-puppet:/var/lib/puppet/yaml/node/server1.mydomain.example.com.yaml
    rsyslog: 
      gnutls_package_name: false
      preserve_fqdn: true
      relp_package_name: false
      rsyslog_package_name: false
    "rsyslog::client": 
      log_local: true
      remote_type: udp
      server: rsyslog.mydomain.example.com
--end--


On the secondary master puppet server

--The Foreman ENC output--
secondary-puppet:/var/lib/puppet/yaml/foreman/server1.mydomain.example.com.yaml
...snip...
  rsyslog:
    gnutls_package_name: false
    preserve_fqdn: true
    relp_package_name: false
    rsyslog_package_name: false
  rsyslog::client:
    log_local: true
    remote_type: udp
    server: rsyslog.mydomain.example.com
...snip...
--end--

--Puppet generated catalog--
secondary-puppet:/var/lib/puppet/yaml/node/server1.mydomain.example.com.yaml
...snip...
    "rsyslog::client": 
      remote_type: udp
      log_local: true
      server: rsyslog.mydomain.example.com
    ntp: 
      server_list: 
        - "ntpserver.mydomain.example.com"
    rsyslog: 
      gnutls_package_name: false
      rsyslog_package_name: false
      preserve_fqdn: true
      relp_package_name: false
...snip...
--end--


-RG

-- 
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/39fa6d99-eb37-4fb1-8e9c-7d04dcf0a574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to