bolt 3.25.0 → 3.26.1
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/lib/bolt/inventory/inventory.rb +15 -6
- data/lib/bolt/outputter/human.rb +2 -2
- data/lib/bolt/plugin/puppetdb.rb +3 -2
- data/lib/bolt/puppetdb/client.rb +3 -3
- data/lib/bolt/version.rb +1 -1
- 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: '0591d13a9aa93f3c96585985ffdf1619c29f3f13130cbde98e1b24a1a357b84b'
|
4
|
+
data.tar.gz: 3fe46914478ad07fab90348eb0464a5e45f5c10fa5f921baf3fa089f8d17cad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a12e686a2ce4a3a15f22e2d45f8210eb6211c910e49e59377e37165554ae5f776c4827dfdb93984d8acdd6295cb7c31f49a090a4239ecc2150bff27f2aeb2bbc
|
7
|
+
data.tar.gz: 5f6ccddd83c3026b1a34be7ab439d800f82cb997f179ab9967ead53c87b5141f2419dce5ae0a29ad17fc4257b294856e39aa61916fca4cbb907919520ad8fbf3
|
@@ -125,16 +125,25 @@ module Bolt
|
|
125
125
|
end
|
126
126
|
|
127
127
|
# If target is a group name, expand it to the members of that group.
|
128
|
-
# Else match against targets in inventory by name or alias.
|
128
|
+
# Else match against groups and targets in inventory by name or alias.
|
129
129
|
# If a wildcard string, error if no matches are found.
|
130
130
|
# Else fall back to [target] if no matches are found.
|
131
131
|
def resolve_name(target, ext_glob: false)
|
132
132
|
if (group = group_lookup[target])
|
133
|
-
group.all_targets
|
133
|
+
group.all_targets.to_a
|
134
134
|
else
|
135
|
-
|
136
|
-
|
137
|
-
|
135
|
+
targets = []
|
136
|
+
|
137
|
+
# Find groups that match the glob
|
138
|
+
group_lookup.each do |name, grp|
|
139
|
+
next unless match_wildcard?(target, name, ext_glob: ext_glob)
|
140
|
+
targets += grp.all_targets.to_a
|
141
|
+
end
|
142
|
+
|
143
|
+
# Find target names that match the glob
|
144
|
+
targets += groups.all_targets.select { |targ| match_wildcard?(target, targ, ext_glob: ext_glob) }
|
145
|
+
|
146
|
+
# Find target aliases that match the glob
|
138
147
|
targets += groups.target_aliases
|
139
148
|
.select { |tgt_alias, _| match_wildcard?(target, tgt_alias, ext_glob: ext_glob) }
|
140
149
|
.values
|
@@ -143,7 +152,7 @@ module Bolt
|
|
143
152
|
raise(WildcardError, target) if target.include?('*')
|
144
153
|
[target]
|
145
154
|
else
|
146
|
-
targets
|
155
|
+
targets.uniq
|
147
156
|
end
|
148
157
|
end
|
149
158
|
end
|
data/lib/bolt/outputter/human.rb
CHANGED
@@ -194,7 +194,7 @@ module Bolt
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
when 'lookup'
|
197
|
-
@stream.puts(indent(2, result['value']))
|
197
|
+
@stream.puts(indent(2, Bolt::Util::Format.stringify(result['value'])))
|
198
198
|
else
|
199
199
|
if result.generic_value.any?
|
200
200
|
@stream.puts(indent(2, ::JSON.pretty_generate(result.generic_value)))
|
@@ -363,7 +363,7 @@ module Bolt
|
|
363
363
|
end
|
364
364
|
usage << (Bolt::Util.powershell? ? ' [-Noop]' : ' [--noop]') if task.supports_noop
|
365
365
|
params.each do |name, data|
|
366
|
-
usage << if data['type']&.start_with?('Optional')
|
366
|
+
usage << if data['type']&.start_with?('Optional') || data.key?('default')
|
367
367
|
" [#{name}=<value>]"
|
368
368
|
else
|
369
369
|
" #{name}=<value>"
|
data/lib/bolt/plugin/puppetdb.rb
CHANGED
@@ -79,8 +79,9 @@ module Bolt
|
|
79
79
|
|
80
80
|
Bolt::Util.walk_vals(template) do |value|
|
81
81
|
# This is done in parts instead of in place so that we only need to
|
82
|
-
# make one puppetDB query
|
83
|
-
|
82
|
+
# make one puppetDB query. Don't gather certname since we already
|
83
|
+
# have that and it's not a fact.
|
84
|
+
if value.is_a?(String) && value != 'certname'
|
84
85
|
facts << fact_path(value)
|
85
86
|
end
|
86
87
|
value
|
data/lib/bolt/puppetdb/client.rb
CHANGED
@@ -110,11 +110,11 @@ module Bolt
|
|
110
110
|
return {} if certnames.empty? || facts.empty?
|
111
111
|
|
112
112
|
certnames.uniq!
|
113
|
-
name_query = certnames.map { |
|
114
|
-
name_query.
|
113
|
+
name_query = certnames.each_slice(100).map { |slice| ["in", "certname", ["array", slice]] }
|
114
|
+
name_query.unshift("or")
|
115
115
|
|
116
116
|
facts_query = facts.map { |f| ["=", "path", f] }
|
117
|
-
facts_query.
|
117
|
+
facts_query.unshift("or")
|
118
118
|
|
119
119
|
query = ['and', name_query, facts_query]
|
120
120
|
|
data/lib/bolt/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.26.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|