bolt 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Puppetfile +1 -1
- data/lib/bolt/plugin/puppetdb.rb +9 -5
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_server/transport_app.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba000a9935f93ebac58dc466b10dc06da8ca5468c9d2d531d2b1067154dd90f1
|
4
|
+
data.tar.gz: 202b98a6d9f6d50dc6864f519a711c4e66a24dab5e16130231164b4c127ea82a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e76933cea7a2b3fd3ee860dd21a938b860892559578c2b494647da0c24308102d81c592c230ee22e676ab5b843db77e38b349b41dff5cfb75bbe7c498ee1e023
|
7
|
+
data.tar.gz: df316bb99de15abb03b2d885f6a46e2a45e8649baea5745f8c9efc7b95cc874b9322a616c0fca7020cac9fb4748ec5d5577f3415833c56ad85e766fcd9bd6bfd
|
data/Puppetfile
CHANGED
@@ -31,7 +31,7 @@ mod 'puppetlabs-ruby_plugin_helper', '0.1.0'
|
|
31
31
|
|
32
32
|
# Plugin modules
|
33
33
|
mod 'puppetlabs-azure_inventory', '0.3.0'
|
34
|
-
mod 'puppetlabs-terraform', '0.
|
34
|
+
mod 'puppetlabs-terraform', '0.5.0'
|
35
35
|
mod 'puppetlabs-vault', '0.3.0'
|
36
36
|
mod 'puppetlabs-aws_inventory', '0.5.0'
|
37
37
|
mod 'puppetlabs-yaml', '0.2.0'
|
data/lib/bolt/plugin/puppetdb.rb
CHANGED
@@ -11,7 +11,7 @@ module Bolt
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
TEMPLATE_OPTS = %w[
|
14
|
+
TEMPLATE_OPTS = %w[alias config facts features name uri vars].freeze
|
15
15
|
PLUGIN_OPTS = %w[_plugin query target_mapping].freeze
|
16
16
|
|
17
17
|
def initialize(pdb_client)
|
@@ -83,10 +83,14 @@ module Bolt
|
|
83
83
|
def resolve_facts(config, certname, target_data)
|
84
84
|
Bolt::Util.walk_vals(config) do |value|
|
85
85
|
if value.is_a?(String)
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
86
|
+
if value == 'certname'
|
87
|
+
certname
|
88
|
+
else
|
89
|
+
data = target_data&.detect { |d| d['path'] == fact_path(value) }
|
90
|
+
warn_missing_fact(certname, value) if data.nil?
|
91
|
+
# If there's no fact data this will be nil
|
92
|
+
data&.fetch('value', nil)
|
93
|
+
end
|
90
94
|
elsif value.is_a?(Array) || value.is_a?(Hash)
|
91
95
|
value
|
92
96
|
else
|
data/lib/bolt/version.rb
CHANGED
@@ -57,12 +57,19 @@ module BoltServer
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def scrub_stack_trace(result)
|
60
|
-
if result.dig(:
|
61
|
-
result[:
|
60
|
+
if result.dig(:value, '_error', 'details', 'stack_trace')
|
61
|
+
result[:value]['_error']['details'].reject! { |k| k == 'stack_trace' }
|
62
62
|
end
|
63
63
|
result
|
64
64
|
end
|
65
65
|
|
66
|
+
def error_result(error)
|
67
|
+
{
|
68
|
+
'status' => 'failure',
|
69
|
+
'value' => { '_error' => error.to_h }
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
66
73
|
def validate_schema(schema, body)
|
67
74
|
schema_error = JSON::Validator.fully_validate(schema, body)
|
68
75
|
if schema_error.any?
|
@@ -280,7 +287,7 @@ module BoltServer
|
|
280
287
|
body = JSON.parse(request.body.read)
|
281
288
|
|
282
289
|
error = validate_schema(@schemas["transport-ssh"], body)
|
283
|
-
return [400, error.to_json] unless error.nil?
|
290
|
+
return [400, error_result(error).to_json] unless error.nil?
|
284
291
|
|
285
292
|
targets = (body['targets'] || [body['target']]).map do |target|
|
286
293
|
make_ssh_target(target)
|
@@ -320,7 +327,7 @@ module BoltServer
|
|
320
327
|
body = JSON.parse(request.body.read)
|
321
328
|
|
322
329
|
error = validate_schema(@schemas["transport-winrm"], body)
|
323
|
-
return [400, error.to_json] unless error.nil?
|
330
|
+
return [400, error_result(error).to_json] unless error.nil?
|
324
331
|
|
325
332
|
targets = (body['targets'] || [body['target']]).map do |target|
|
326
333
|
make_winrm_target(target)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|