knife-depsolver 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -3
- data/lib/chef/knife/depsolver.rb +5 -5
- data/lib/knife-depsolver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d898d03bc79de23335e1ce6f1d81ca9cc68527d9
|
4
|
+
data.tar.gz: 9fc64f30535ff4441cacd2316dceeacb1ce66345
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eae154d12a6d07c72fa13a8a3b89b96849bf7b5ca6d3b42f614573c239a432d2f550164810b2cdbbb4ff7fc95b94f00256ed01745f183edb31b71730cc61b38
|
7
|
+
data.tar.gz: 60cd833bbe8e5f321e453fe41cba4ab78652e96bdb99d63b8a83709526634454c8564c72abb05178868cf6081a8c42a55c314a0352f8369c5028736561a6cc5a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -38,6 +38,8 @@ opscode-erchef to send a list of cookbook file metadata back to the chef-client
|
|
38
38
|
chef gem install knife-depsolver
|
39
39
|
```
|
40
40
|
|
41
|
+
*Currently NOT compatible with Windows Chef DK*
|
42
|
+
|
41
43
|
### Using knife-depsolver with Chef Server's depsolver
|
42
44
|
|
43
45
|
Find the depsolver solution for a node's run_list.
|
@@ -95,7 +97,7 @@ Now use the "--env-constraints", "universe" and "expanded-run-list" options to p
|
|
95
97
|
For example:
|
96
98
|
|
97
99
|
```
|
98
|
-
knife depsolver --env-constraints rehearsal-environment-
|
100
|
+
knife depsolver --env-constraints rehearsal-environment-2017-05-01-18.52.40-5f5843d819ecb0b174f308d76d4336bb7bbfacbf.txt --universe automate-universe-2017-05-01-18.52.40-1c8e59e23530b1e1a8e0b3b3cc5236a29c84e469.txt --expanded-run-list expanded-run-list-2017-05-01-18.52.40-387d90499514747792a805213c30be13d830d31f.txt
|
99
101
|
```
|
100
102
|
|
101
103
|
Now it is easy to modify any combination of the expanded run list, the environment cookbook version constraints or the cookbook universe in those files and see the impact on the depsolver in an effort to isolate the problem.
|
@@ -103,7 +105,7 @@ Now it is easy to modify any combination of the expanded run list, the environme
|
|
103
105
|
Sometimes it can help to give the depsolver more than the default five seconds to perform its calculations. This can be done by using the "--timeout <seconds>" option to change the depsolver timeout.
|
104
106
|
|
105
107
|
```
|
106
|
-
knife depsolver --env-constraints production-environment-
|
108
|
+
knife depsolver --env-constraints production-environment-2017-05-01-18.52.40-5f5843d819ecb0b174f308d76d4336bb7bbfacbf.txt --universe my-org-universe-2017-05-01-18.52.40-1c8e59e23530b1e1a8e0b3b3cc5236a29c84e469.txt --expanded-run-list expanded-run-list-2017-05-01-18.52.40-387d90499514747792a805213c30be13d830d31f.txt --timeout 120
|
107
109
|
```
|
108
110
|
|
109
111
|
### Chef Server <= 12.4.0
|
@@ -137,7 +139,11 @@ ORDER BY updated_at DESC;
|
|
137
139
|
EOF
|
138
140
|
```
|
139
141
|
|
140
|
-
Then you can run
|
142
|
+
Then you can run the following command to convert it to the normal JSON format.
|
143
|
+
|
144
|
+
```
|
145
|
+
knife depsolver --csv-universe-to-json universe.csv
|
146
|
+
```
|
141
147
|
|
142
148
|
If the Chef Server doesn't have the "chef-server-ctl psql" command available then you can try replacing that line with the following.
|
143
149
|
|
data/lib/chef/knife/depsolver.rb
CHANGED
@@ -100,7 +100,7 @@ class Chef
|
|
100
100
|
end
|
101
101
|
|
102
102
|
universe_json = JSON.pretty_generate(universe)
|
103
|
-
universe_filename = "universe-#{Time.now.strftime("%Y-%m-%d-%H
|
103
|
+
universe_filename = "universe-#{Time.now.strftime("%Y-%m-%d-%H.%M.%S")}-#{Digest::SHA1.hexdigest(universe_json)}.txt"
|
104
104
|
IO.write(universe_filename, universe_json)
|
105
105
|
puts "Cookbook universe saved to #{universe_filename}"
|
106
106
|
exit!
|
@@ -147,7 +147,7 @@ class Chef
|
|
147
147
|
end
|
148
148
|
env = { name: node.chef_environment, cookbook_versions: environment_cookbook_versions }
|
149
149
|
environment_constraints_json = JSON.pretty_generate(env)
|
150
|
-
environment_constraints_filename = "#{node.chef_environment}-environment-#{Time.now.strftime("%Y-%m-%d-%H
|
150
|
+
environment_constraints_filename = "#{node.chef_environment}-environment-#{Time.now.strftime("%Y-%m-%d-%H.%M.%S")}-#{Digest::SHA1.hexdigest(environment_constraints_json)}.txt"
|
151
151
|
IO.write(environment_constraints_filename, environment_constraints_json)
|
152
152
|
puts "Environment constraints saved to #{environment_constraints_filename}"
|
153
153
|
|
@@ -156,7 +156,7 @@ class Chef
|
|
156
156
|
universe_json = JSON.pretty_generate(universe)
|
157
157
|
universe_filename = ""
|
158
158
|
rest.url.to_s.match(".*/organizations/(.*)/?") { universe_filename = "#{$1}-" }
|
159
|
-
universe_filename += "universe-#{Time.now.strftime("%Y-%m-%d-%H
|
159
|
+
universe_filename += "universe-#{Time.now.strftime("%Y-%m-%d-%H.%M.%S")}-#{Digest::SHA1.hexdigest(universe_json)}.txt"
|
160
160
|
IO.write(universe_filename, universe_json)
|
161
161
|
puts "Cookbook universe saved to #{universe_filename}"
|
162
162
|
rescue Net::HTTPServerException
|
@@ -208,7 +208,7 @@ class Chef
|
|
208
208
|
versions.delete_if {|version, v| !env_constraints[name].include?(version)} if env_constraints[name]
|
209
209
|
end
|
210
210
|
filtered_universe_json = JSON.pretty_generate(universe)
|
211
|
-
filtered_universe_filename = "filtered-universe-#{Time.now.strftime("%Y-%m-%d-%H
|
211
|
+
filtered_universe_filename = "filtered-universe-#{Time.now.strftime("%Y-%m-%d-%H.%M.%S")}-#{Digest::SHA1.hexdigest(filtered_universe_json)}.txt"
|
212
212
|
IO.write(filtered_universe_filename, filtered_universe_json)
|
213
213
|
puts "Filtered cookbook universe saved to #{filtered_universe_filename}"
|
214
214
|
exit!
|
@@ -309,7 +309,7 @@ class Chef
|
|
309
309
|
|
310
310
|
if config[:capture]
|
311
311
|
results_json = JSON.pretty_generate(results)
|
312
|
-
expanded_run_list_filename = "expanded-run-list-#{Time.now.strftime("%Y-%m-%d-%H
|
312
|
+
expanded_run_list_filename = "expanded-run-list-#{Time.now.strftime("%Y-%m-%d-%H.%M.%S")}-#{Digest::SHA1.hexdigest(results_json)}.txt"
|
313
313
|
IO.write(expanded_run_list_filename, results_json)
|
314
314
|
puts "Expanded run list saved to #{expanded_run_list_filename}"
|
315
315
|
else
|