voxpupuli / puppet-kibana

Kibana Puppet module by Elastic.
Apache License 2.0
16 stars 48 forks source link

Discrepancy in lib/puppet_x/elastic/hash.rb library file between kibana and elasticsearch modules #21

Closed asmajlovic closed 6 years ago

asmajlovic commented 6 years ago

Bug Report

Bug description

While relatively minor (a bit annoying for us), a discrepancy has been noted in the lib/puppet_x/elastic/hash.rb content between the kibana and elasticsearch Puppet modules. Depending on which Puppet environment is used, one or the other is used to update the agent. The issue is being opened here since a rubocop:disable line is missing in the kibana library file.

Expected behavior: No changes between Puppet agent runs using different environments referencing with same code

Observed behavior: # rubocop:disable Metrics/AbcSize line is added/removed, depending on which module is considered first/last.

File differences:

# diff modules/vendor/elasticsearch/lib/puppet_x/elastic/hash.rb modules/vendor/kibana/lib/puppet_x/elastic/hash.rb
10d9
<       # rubocop:disable Metrics/AbcSize

Example:

Notice: /File[/var/lib/puppet/lib/puppet_x/elastic/hash.rb]/content: content changed '{md5}5482a43a74b80467b5078cab48aa3cf7' to '{md5}10dc543476cf0efdacae56694403f705' Info: Loading facts Info: Caching catalog for adm-dev-test01.local Info: Applying configuration version '1520589951' Notice: Finished catalog run in 4.64 seconds


- Environment `xyz`

puppet agent -t --environment env2

Info: Retrieving pluginfacts Notice: /File[/var/lib/puppet/facts.d]/mode: mode changed '0755' to '0775' Info: Retrieving plugin Notice: /File[/var/lib/puppet/lib/puppet_x/elastic/hash.rb]/content: --- /var/lib/puppet/lib/puppet_x/elastic/hash.rb 2018-03-09 10:05:48.416069199 +0000 +++ /tmp/puppet-file20180309-31219-1y9m6eg 2018-03-09 10:10:59.882337244 +0000 @@ -7,6 +7,7 @@

Upon extension, modify the hash appropriately to render

   # sorted yaml dependent upon whichever way is supported for
   # this version of Puppet/Ruby's yaml implementation.

Notice: /File[/var/lib/puppet/lib/puppet_x/elastic/hash.rb]/content: content changed '{md5}10dc543476cf0efdacae56694403f705' to '{md5}5482a43a74b80467b5078cab48aa3cf7' Info: Loading facts Info: Caching catalog for adm-dev-test01.local Info: Applying configuration version '1520590263' Notice: Finished catalog run in 5.33 seconds



<!--
If you are filing a feature request, please remove the above bug
report block and describe the feature below the heading.
-->
tylerjl commented 6 years ago

Thanks for the report @asmajlovic, this definitely shouldn't be happening. I'm refactoring much of the test/linting setup for the Elasticsearch and Kibana modules to ensure we syntax check against Ruby 1.9 syntax for elastic/puppet-elasticsearch#922, so I'm in the middle of working on these sorts of changes and should be able to resolve them.