A tool to compare 2 Puppet catalogs.

PLEASE NOTE: This is still early code, its a work in progress specifically I am working on 0.24.x compatibility

While upgrading versions of Puppet you want to ensure that
no unexpected changes will be made prior to doing the upgrade.

This tool will allow you to diff catalogs created by different
versions of Puppet.  This will let you guage the impact of a
Puppet upgrade before actually touching any of your nodes.

This is the first version of the code that works, it's not
clean code or tested throughly, as I use it to do upgrades in
the near future there will no doubt be refinements.

Validation Process:

 - Grab a catalog from your existing machine running the old version
 - Copy it locally and run:

      dumplocalconfig.rb --format yaml --output 0.24.yaml fqdn.yaml

 - Configure your new Puppet master, copy the facts from your old master
   to the new one
 - Compile the catalog for this host on the new master:

      puppet master --compile fqdn > fqdn.pson

 - Copy the catalog over and run:

      dumplocalconfig.rb --format pson --output 2.6.yaml fqdn.pson

 - At this point you should have 2 different catalogs to compare them run:

      diffcatalogs.rb 0.24.yaml 2.6.yaml


Example Output:

During the transition of 0.24.x to 0.25.x there was a serialization bug
that resulted in unexpected file content changes, I've recreated this bug
in a tiny 2 resource catalog, the output below shows how this tool would
have highlighted this bug prior to upgrading any nodes.

	Resource counts:
		Old: 2
		New: 2

	Catalogs contain the same resources by resource title


	Individual Resource differences:
	Old Resource:
	  file{"/tmp/foo":
		content => d3b07384d113edec49eaa6238ad5ff00
	  }

	New Resource:
	  file{"/tmp/foo":
		content => dbb53f3699703c028483658773628452
	  }

Had resources imply gone missing - not the case here - you would have seen
a list of that.

This code only validates the catalogs, it cannot tell you if the behavior of
the providers that interpret the catalog has changed so testing is still
recommended, this is just one tool to take away some of the uncertainty

Changelog:

 - 2010/10/19 - Change options and logic so it's easier to use comparing catalogs
                from the same version of puppet

Contact:

R.I.Pienaar <rip@devco.net>
www.devco.net
@ripienaar