puppet_litmus 0.18.1 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b3fcb695b5204b13b091211f12201ade70cd34af04ad8aefd81856f5b212116
4
- data.tar.gz: 4f941ab55af8dbed7848e39fbdbeba76586aabce36a1a52194d76cee6680ecf3
3
+ metadata.gz: c9148f5cf259702d6b12f875555b4cbef8fdbc4ff78081e495ca1b9b8948d082
4
+ data.tar.gz: 3b002919bfff6ce6cb794ed9bd3d8b6b5712ba76d1cceceba1c8d205488f9057
5
5
  SHA512:
6
- metadata.gz: 8254a6ec0ffe6a9d398730de3a4c5878330ece15912ebc39d560bb3e811616e05319f4577434d457088e44f48391e043579f808ec5d4628e2ed0bd49843bbf70
7
- data.tar.gz: cb009e0328b4373a3fccb987a02c143f0b61bd5ae6c3718ee9adb6553242b057a0674dc84cb13f6aa0f31821a130aeec1db8498a8957dbe5ba8eb2a2263332b5
6
+ metadata.gz: 458f9935cf9148d839f0a2ac3cb3851a85ef18df7a7e99a0b216adafb9d33999a1d672da95f5450c1b371794cd6ecf7d92131778d79cdb47ea0cd0788e1901c4
7
+ data.tar.gz: 4c1c40a1b40865ff788af2f52c6766a5f5d159674ce3f62173da91713dd96f5e1e78f1fb41234e5a7d82aa89c1cb1b2f35a29c841bf2e3307719506c4a130793
@@ -135,7 +135,7 @@ module PuppetLitmus::PuppetHelpers
135
135
  span.add_field('litmus.node_name', target_node_name)
136
136
  add_platform_field(inventory_hash, target_node_name)
137
137
 
138
- manifest_file_location = "/tmp/#{File.basename(manifest_file)}"
138
+ manifest_file_location = File.basename(manifest_file)
139
139
  bolt_result = upload_file(manifest_file.path, manifest_file_location, target_node_name, options: {}, config: nil, inventory: inventory_hash)
140
140
  span.add_field('litmus.bolt_result', bolt_result)
141
141
  raise bolt_result.first['value'].to_s unless bolt_result.first['status'] == 'success'
@@ -119,8 +119,8 @@ module PuppetLitmus::RakeHelper
119
119
  span.add_field('litmus.config', DEFAULT_CONFIG_DATA)
120
120
 
121
121
  bolt_result = run_task(provisioner_task(provisioner), 'localhost', params, config: DEFAULT_CONFIG_DATA, inventory: nil)
122
-
123
122
  span.add_field('litmus.node_name', bolt_result&.first&.dig('value', 'node_name'))
123
+ raise_bolt_errors(bolt_result, "provisioning of #{platform} failed.")
124
124
 
125
125
  bolt_result
126
126
  end
@@ -170,7 +170,9 @@ module PuppetLitmus::RakeHelper
170
170
 
171
171
  params = { 'action' => 'tear_down', 'node_name' => node_name, 'inventory' => Dir.pwd }
172
172
  node_facts = facts_from_node(inventory_hash, node_name)
173
- run_task(provisioner_task(node_facts['provisioner']), 'localhost', params, config: DEFAULT_CONFIG_DATA, inventory: nil)
173
+ bolt_result = run_task(provisioner_task(node_facts['provisioner']), 'localhost', params, config: DEFAULT_CONFIG_DATA, inventory: nil)
174
+ raise_bolt_errors(bolt_result, "tear_down of #{node_name} failed.")
175
+ bolt_result
174
176
  end
175
177
  end
176
178
 
@@ -238,14 +240,14 @@ module PuppetLitmus::RakeHelper
238
240
 
239
241
  target_nodes = find_targets(inventory_hash, target_node_name)
240
242
  span.add_field('litmus.target_nodes', target_nodes)
241
- bolt_result = upload_file(module_tar, "/tmp/#{File.basename(module_tar)}", target_nodes, options: {}, config: nil, inventory: inventory_hash.clone)
243
+ bolt_result = upload_file(module_tar, File.basename(module_tar), target_nodes, options: {}, config: nil, inventory: inventory_hash.clone)
242
244
  raise_bolt_errors(bolt_result, 'Failed to upload module.')
243
245
 
244
- install_module_command = "puppet module install --module_repository '#{module_repository}' /tmp/#{File.basename(module_tar)}"
246
+ install_module_command = "puppet module install --module_repository '#{module_repository}' #{File.basename(module_tar)}"
245
247
  span.add_field('litmus.install_module_command', install_module_command)
246
248
 
247
249
  bolt_result = run_command(install_module_command, target_nodes, config: nil, inventory: inventory_hash.clone)
248
- raise_bolt_errors(bolt_result, "Installation of package #{module_tar} failed.")
250
+ raise_bolt_errors(bolt_result, "Installation of package #{File.basename(module_tar)} failed.")
249
251
  bolt_result
250
252
  end
251
253
  end
@@ -291,7 +293,10 @@ module PuppetLitmus::RakeHelper
291
293
  target_nodes = find_targets(inventory_hash, target_node_name)
292
294
  install_module_command = "puppet module uninstall #{module_name}"
293
295
  install_module_command += ' --force' if opts[:force]
294
- run_command(install_module_command, target_nodes, config: nil, inventory: inventory_hash)
296
+ bolt_result = run_command(install_module_command, target_nodes, config: nil, inventory: inventory_hash)
297
+ # `puppet module uninstall --force` fails if the module is not installed. Ignore errors when force is set
298
+ raise_bolt_errors(bolt_result, "uninstalling #{module_name} failed.") unless opts[:force]
299
+ bolt_result
295
300
  end
296
301
 
297
302
  def check_connectivity?(inventory_hash, target_node_name)
@@ -330,7 +335,7 @@ module PuppetLitmus::RakeHelper
330
335
  # Parse out errors messages in result set returned by Bolt command.
331
336
  #
332
337
  # @param result_set [Array] result set returned by Bolt command.
333
- # @return [Hash] Error messages grouped by target.
338
+ # @return [Hash] Errors grouped by target.
334
339
  def check_bolt_errors(result_set)
335
340
  errors = {}
336
341
  # iterate through each error
@@ -341,8 +346,7 @@ module PuppetLitmus::RakeHelper
341
346
 
342
347
  target = target_result['target']
343
348
  # get some info from error
344
- error_msg = target_result['value']['_error']['msg']
345
- errors[target] = error_msg
349
+ errors[target] = target_result['value']['_error']
346
350
  end
347
351
  errors
348
352
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.18.1'
5
+ VERSION ||= '0.18.2'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_litmus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-02 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt
@@ -140,6 +140,46 @@ dependencies:
140
140
  - - ">="
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
+ - !ruby/object:Gem::Dependency
144
+ name: ed25519
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '1.2'
150
+ - - "<"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.0'
153
+ type: :runtime
154
+ prerelease: false
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '1.2'
160
+ - - "<"
161
+ - !ruby/object:Gem::Version
162
+ version: '2.0'
163
+ - !ruby/object:Gem::Dependency
164
+ name: bcrypt_pbkdf
165
+ requirement: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '1.0'
170
+ - - "<"
171
+ - !ruby/object:Gem::Version
172
+ version: '2.0'
173
+ type: :runtime
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '1.0'
180
+ - - "<"
181
+ - !ruby/object:Gem::Version
182
+ version: '2.0'
143
183
  description: " Providing a simple command line tool for puppet content creators,
144
184
  to enable simple and complex test deployments.\n"
145
185
  email:
@@ -187,20 +227,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
227
  - !ruby/object:Gem::Version
188
228
  version: '0'
189
229
  requirements: []
190
- rubyforge_project:
191
- rubygems_version: 2.7.6.2
230
+ rubygems_version: 3.1.2
192
231
  signing_key:
193
232
  specification_version: 4
194
233
  summary: Providing a simple command line tool for puppet content creators, to enable
195
234
  simple and complex test deployments.
196
235
  test_files:
197
- - spec/data/doot.tar.gz
198
- - spec/data/inventory.yaml
199
- - spec/data/jim.yaml
200
- - spec/lib/puppet_litmus/util_spec.rb
236
+ - spec/spec_helper.rb
237
+ - spec/lib/puppet_litmus/rake_tasks_spec.rb
201
238
  - spec/lib/puppet_litmus/version_spec.rb
239
+ - spec/lib/puppet_litmus/util_spec.rb
202
240
  - spec/lib/puppet_litmus/inventory_manipulation_spec.rb
203
- - spec/lib/puppet_litmus/puppet_helpers_spec.rb
204
- - spec/lib/puppet_litmus/rake_tasks_spec.rb
205
241
  - spec/lib/puppet_litmus/rake_helper_spec.rb
206
- - spec/spec_helper.rb
242
+ - spec/lib/puppet_litmus/puppet_helpers_spec.rb
243
+ - spec/data/doot.tar.gz
244
+ - spec/data/jim.yaml
245
+ - spec/data/inventory.yaml