puppet-catalog-diff
puppet-catalog-diff copied to clipboard
compare branches
Would it be possible to utilize this module to compare results of compiling catalogs on the same master, but different branches of the code. This would be very helpful to determine if a refactored code would affect the resulting catalog on the same puppet master.
Thanks, Vadym
@vchepkov this is already possible, using /
:
puppet catalog diff master/env1 master/env2
I will try. Is it possible to test changed code for custom facts as well? Come to think of it, new version of puppet also can change facts for the node.
I mist be doing something wrong, could you point me to the proper direction, please? These are all the steps I performed (t410.chepkov.lan is my master, I ran command on the master):
- vi /etc/puppetlabs/puppet/auth.conf
path ~ ^/puppet/v3/catalog/([^/]+)$
method find
auth yes
allow $1
allow t410.chepkov.lan
path /puppet/v3/facts
method find, search
auth any
allow pe-internal-dashboard
allow t410.chepkov.lan
- restarted puppetserver
# service pe-puppetserver restart
- updated example script
#!/bin/bash -x
export RUBYLIB=/etc/puppetlabs/code/modules/catalog_diff/lib
export YAMLDIR=/opt/puppetlabs/puppet/cache/yaml
export SSLDIR=/etc/puppetlabs/puppet/ssl
export PUSER='pe-puppet'
[ $USER == $PUSER ] || exit 1
/opt/puppetlabs/bin/puppet catalog diff t410.chepkov.lan/development t410.chepkov.lan/production \
--show_resource_diff \
--content_diff \
--yamldir $YAMLDIR \
--ssldir $SSLDIR \
--changed_depth 1000 \
--render-as json \
--debug \
--output_report "/tmp/lastrun-$$.json" \
--threads 50
- get an error
Debug: Runtime environment: puppet_version=4.4.1, ruby_version=2.1.8, run_mode=user, default_encoding=UTF-8
Error: Add --debug for realtime output, add --render-as {json,yaml} for parsed output
...
Error: Received invalid data from facts endpoint: source '<html>
<head>
<meta ' not in PSON!
Error: Try 'puppet help catalog diff' for usage
I tried the same steps on different PE versions - 3.3, 3.8 and the one above on PE2016 (adjusted for the auth.conf paths) - result is exactly the same.
Did I miss something? Thanks. Vadym
for the reference, this is what I get on PE3.3:
+ export RUBYLIB=/etc/puppetlabs/puppet/modules/catalog_diff/lib
+ RUBYLIB=/etc/puppetlabs/puppet/modules/catalog_diff/lib
+ export YAMLDIR=/var/opt/lib/pe-puppet/yaml
+ YAMLDIR=/var/opt/lib/pe-puppet/yaml
+ export SSLDIR=/etc/puppetlabs/puppet/ssl
+ SSLDIR=/etc/puppetlabs/puppet/ssl
+ export PUSER=pe-puppet
+ PUSER=pe-puppet
+ '[' pe-puppet == pe-puppet ']'
...
Error: Received invalid data from facts endpoint: source 'Not Found: Could not' not in PSON!
Error: Try 'puppet help catalog diff' for usage