forked from ripienaar/puppet-catalog-diff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
79 lines (52 loc) · 2.3 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 <[email protected]>
www.devco.net
@ripienaar