|
1 | 1 | require 'puppet/face' |
2 | 2 | require 'json' |
3 | | -require 'puppet/util/puppetdb' |
| 3 | +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'catalog-diff', 'puppetdbfactory.rb')) |
4 | 4 |
|
5 | 5 | begin |
6 | 6 | require 'parallel' |
|
13 | 13 | action :diff do |
14 | 14 | summary 'Compare catalogs from different puppet versions.' |
15 | 15 | arguments '<catalog1> <catalog2>' |
16 | | - puppetdb_url = Puppet::Util::Puppetdb.config.server_urls[0] |
| 16 | + puppetdb_url = Puppet::CatalogDiff::Puppetdbfactory.puppetdb_url |
17 | 17 | hostcert = Puppet.settings[:hostcert] |
18 | 18 | hostprivkey = Puppet.settings[:hostprivkey] |
19 | 19 | localcacert = Puppet.settings[:localcacert] |
|
136 | 136 |
|
137 | 137 | Validation Process: |
138 | 138 |
|
139 | | - - Grab a catalog from your existing machine running the old version |
140 | | - - Configure your new Puppet master, copy the facts from your old master |
141 | | - to the new one |
142 | | - - Compile the catalog for this host on the new master: |
| 139 | + - Grab a catalog from your existing machine running the old version |
| 140 | + - Configure your new Puppet master, copy the facts from your old master |
| 141 | + to the new one |
| 142 | + - Compile the catalog for this host on the new master: |
143 | 143 |
|
144 | | - puppet master --compile fqdn > fqdn.pson |
| 144 | + puppet master --compile fqdn > fqdn.pson |
145 | 145 |
|
146 | | - - Puppet puts a header in some catalogs compiled in this way, remove it if present |
147 | | - - At this point you should have 2 different catalogs. To compare them run: |
| 146 | + - Puppet puts a header in some catalogs compiled in this way, remove it if present |
| 147 | + - At this point you should have 2 different catalogs. To compare them run: |
148 | 148 |
|
149 | | - puppet catalog diff <catalog1> <catalog2> |
150 | | - - Alternatively you can process a directory containing matching files |
151 | | - - i.e. path/to/old/node_name.yaml and path/to/new/node_name.yaml |
152 | | - puppet catalog diff <path/to/old> <path/to/new> |
| 149 | + puppet catalog diff <catalog1> <catalog2> |
| 150 | +
|
| 151 | + - Alternatively you can process a directory containing matching files |
| 152 | + - i.e. path/to/old/node_name.yaml and path/to/new/node_name.yaml |
| 153 | +
|
| 154 | + puppet catalog diff <path/to/old> <path/to/new> |
153 | 155 |
|
154 | 156 | This code only validates the catalogs, it cannot tell you if the behavior of |
155 | 157 | the providers that interpret the catalog has changed so testing is still |
|
0 commit comments