puppet_litmus 0.3.1 → 0.4.0

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
  SHA1:
3
- metadata.gz: 2313968959eb8e8f6e074f4273365fc0f97931fa
4
- data.tar.gz: 11077ee9871bf76777c4ea41629293558db5d2eb
3
+ metadata.gz: b8793e294b24574549eb709f40fd2f4c60a7995e
4
+ data.tar.gz: 5f786dd179b80096027dbd60a5a0e3cfb805dc19
5
5
  SHA512:
6
- metadata.gz: dbd1c581d0404fa912b4560fc86d10b8d3ea7a50ce5add51c7071de96a1899fedc27f55dd6b9352ee10fa78529a8fc8fb55787bcc836bcef97ca3516fd58d268
7
- data.tar.gz: 9b60c27d7d116d6e82e333563c31859592a76774c748df3561c897c7692c42677682598a523387f6c4b52ebd5c2ac9e4e0f4a7dca5070799ab319ab3a3aae027
6
+ metadata.gz: ddb4a53476e159cf891c661830f6d94af3600c1a6ce4127ca3cd7b9401aa51cd3efca458794b0e8ebd040b3269f783b52da3e285a1a99892ce0e9ae7f5e693b5
7
+ data.tar.gz: 9a730ae696a455ecd35ec5c544920b0a349a59aa9c42c63f897fe20d0c7e2dfe9757ae2cbee70bd3ce5a5a61b05569cc62f4f20418a94d7cf0cac8adb28f2325
@@ -116,13 +116,9 @@ namespace :litmus do
116
116
 
117
117
  params = { 'action' => 'provision', 'platform' => args[:platform], 'inventory' => Dir.pwd }
118
118
  results = run_task("provision::#{args[:provisioner]}", 'localhost', params, config: config_data, inventory: nil)
119
- results.each do |result|
120
- if result['status'] != 'success'
121
- puts "Failed #{result['node']}\n#{result}"
122
- else
123
- puts "#{result['result']['node_name']}, #{args[:platform]}"
124
- end
125
- end
119
+ raise "Failed provisioning #{args[:platform]} using #{args[:provisioner]}\n#{results.first}" if results.first['status'] != 'success'
120
+
121
+ puts "#{results.first['result']['node_name']}, #{args[:platform]}"
126
122
  end
127
123
 
128
124
  desc 'install puppet agent, [:collection, :target_node_name]'
@@ -144,7 +140,7 @@ namespace :litmus do
144
140
  results.each do |result|
145
141
  if result['status'] != 'success'
146
142
  command_to_run = "bolt task run puppet_agent::install --targets #{result['node']} --inventoryfile inventory.yaml --modulepath #{config_data['modulepath']}"
147
- puts "Failed on #{result['node']}\n#{result}\ntry running '#{command_to_run}'"
143
+ raise "Failed on #{result['node']}\n#{result}\ntry running '#{command_to_run}'"
148
144
  end
149
145
  end
150
146
 
@@ -24,6 +24,7 @@ module PuppetLitmus::Serverspec
24
24
  # :manifest_file_location [Path] The place on the target system.
25
25
  # :prefix_command [String] prefixes the puppet apply command; eg "export LANGUAGE='ja'".
26
26
  # :debug [Boolean] run puppet apply with the debug flag.
27
+ # :noop [Boolean] run puppet apply with the noop flag.
27
28
  # @param [Block] his method will yield to a block of code passed by the caller; this can be used for additional validation, etc.
28
29
  # @return [Object] A result object from the apply.
29
30
  def apply_manifest(manifest, opts = {})
@@ -42,6 +43,7 @@ module PuppetLitmus::Serverspec
42
43
  command_to_run += " --modulepath #{Dir.pwd}/spec/fixtures/modules" if target_node_name.nil? || target_node_name == 'localhost'
43
44
  command_to_run += ' --detailed-exitcodes' if !opts[:catch_changes].nil? && (opts[:catch_changes] == true)
44
45
  command_to_run += ' --debug' if !opts[:debug].nil? && (opts[:debug] == true)
46
+ command_to_run += ' --noop' if !opts[:noop].nil? && (opts[:noop] == true)
45
47
  result = run_command(command_to_run, target_node_name, config: nil, inventory: inventory_hash)
46
48
 
47
49
  raise "apply manifest failed\n`#{command_to_run}`\n======\n#{result}" if result.first['result']['exit_code'] != 0 && opts[:expect_failures] != true
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.3.1'
5
+ VERSION ||= '0.4.0'
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.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-29 00:00:00.000000000 Z
11
+ date: 2019-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt