Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff same server in 2 environments? #49

Open
KlavsKlavsen opened this issue Jan 9, 2018 · 0 comments
Open

diff same server in 2 environments? #49

KlavsKlavsen opened this issue Jan 9, 2018 · 0 comments

Comments

@KlavsKlavsen
Copy link

I am trying to diff catalog for the same server - in two different environments (using same puppetmaster).
But when I run:
time /opt/puppetlabs/puppet/bin/puppet catalog diff myweb01.example.com/production myweb01.example.com/devel1
--show_resource_diff
--content_diff
--yamldir $YAMLDIR
--ssldir $SSLDIR
--changed_depth 1000
--configtimeout 1000
--output_report "${HOME}/lastrun-$$.json"
--debug
--threads 50 | tee -a lastrun-$$.log

I get this odd error:
Error: Error retrieving facts from dmz-puppet-p01.example.com: Server hostname 'dmz-puppet-p01.example.com' did not match server certificate; expected one of "puppet master cert names"
Error: Try 'puppet help catalog diff' for usage

I would like to test the change in my devel1 environment against all of my servers (or atleast many) - to see what servers it will affect (and what it will do).

natemccurdy added a commit to natemccurdy/puppet-catalog-diff that referenced this issue Jun 21, 2021
Prior to this, when viewing the report in the console after diffing to
catalog files, the word "false" would show up right next to the number
of "Nodes with the most changes by differences".

For example, note the errant "false" at the end of this:
```
--------------------------------------------------------------------------------
1 out of 1 nodes changed.                                   0.34%
--------------------------------------------------------------------------------

Nodes with the most changes by percent changed:
1. foo.bar.net-production                                     0.34%

Nodes with the most changes by differences:
1. foo.bar.net-some_feature                                   8false
```

This was due to a Ruby `.key?` check inside a string interpolation of
`nodes[:puppet_ouput]`, which when ":pull_output" was not a key in the
`nodes` hash evaluated to `false`. And since `false` was inside the
string interpolation, it got printed to the console.

This fixes that by switching to the "x if condition y" format of
conditional logic, which hides the output of the `.key?` check.

After this commit, the console output does not contain the word "false".
```
--------------------------------------------------------------------------------
1 out of 1 nodes changed.                                   0.34%
--------------------------------------------------------------------------------

Nodes with the most changes by percent changed:
1. foo.bar.net-production                                     0.34%

Nodes with the most changes by differences:
1. foo.bar.net-some_feature                                   8
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant