bolt 0.16.0 → 0.16.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/cli.rb +32 -17
- data/lib/bolt/config.rb +12 -31
- data/lib/bolt/error.rb +18 -7
- data/lib/bolt/executor.rb +3 -3
- data/lib/bolt/inventory.rb +101 -0
- data/lib/bolt/inventory/group.rb +127 -0
- data/lib/bolt/node.rb +10 -9
- data/lib/bolt/node/ssh.rb +86 -69
- data/lib/bolt/node/winrm.rb +3 -3
- data/lib/bolt/outputter/human.rb +1 -1
- data/lib/bolt/pal.rb +17 -11
- data/lib/bolt/result.rb +9 -4
- data/lib/bolt/target.rb +26 -11
- data/lib/bolt/util.rb +54 -0
- data/lib/bolt/version.rb +1 -1
- data/modules/boltlib/lib/puppet/functions/fail_plan.rb +27 -0
- data/modules/boltlib/lib/puppet/functions/file_upload.rb +4 -4
- data/modules/boltlib/lib/puppet/functions/run_command.rb +3 -3
- data/modules/boltlib/lib/puppet/functions/run_plan.rb +18 -4
- data/modules/boltlib/lib/puppet/functions/run_script.rb +5 -2
- data/modules/boltlib/lib/puppet/functions/run_task.rb +3 -3
- data/vendored/puppet/lib/puppet/datatypes/error.rb +5 -3
- data/vendored/puppet/lib/puppet/datatypes/impl/error.rb +10 -12
- data/vendored/puppet/lib/puppet/defaults.rb +33 -25
- data/vendored/puppet/lib/puppet/etc.rb +2 -2
- data/vendored/puppet/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/vendored/puppet/lib/puppet/external/pson/pure/parser.rb +1 -1
- data/vendored/puppet/lib/puppet/face/config.rb +45 -0
- data/vendored/puppet/lib/puppet/face/module/generate.rb +5 -0
- data/vendored/puppet/lib/puppet/functions/annotate.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/any.rb +1 -1
- data/vendored/puppet/lib/puppet/generate/type.rb +1 -1
- data/vendored/puppet/lib/puppet/gettext/config.rb +2 -2
- data/vendored/puppet/lib/puppet/gettext/stubs.rb +1 -1
- data/vendored/puppet/lib/puppet/interface/action.rb +11 -0
- data/vendored/puppet/lib/puppet/interface/action_builder.rb +8 -0
- data/vendored/puppet/lib/puppet/network/authstore.rb +1 -1
- data/vendored/puppet/lib/puppet/network/http/connection.rb +1 -1
- data/vendored/puppet/lib/puppet/parameter/boolean.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/ast/branch.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/new.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/evaluator_impl.rb +3 -3
- data/vendored/puppet/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/issues.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/loader/loader.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +3 -5
- data/vendored/puppet/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/loader/runtime3_type_loader.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/loaders.rb +40 -1
- data/vendored/puppet/lib/puppet/pops/lookup/interpolation.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/epp_support.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/interpolation_support.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/lexer2.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/lexer_support.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/parser/locatable.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/locator.rb +2 -6
- data/vendored/puppet/lib/puppet/pops/resource/param.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/iterable.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/tree_iterators.rb +5 -1
- data/vendored/puppet/lib/puppet/pops/types/type_acceptor.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/type_calculator.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/type_with_members.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/types.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/package/yum.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/service/redhat.rb +3 -2
- data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/vendored/puppet/lib/puppet/resource/type.rb +1 -1
- data/vendored/puppet/lib/puppet/settings/base_setting.rb +1 -1
- data/vendored/puppet/lib/puppet/settings/ini_file.rb +33 -12
- data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +2 -2
- data/vendored/puppet/lib/puppet/transaction.rb +37 -14
- data/vendored/puppet/lib/puppet/type/cron.rb +1 -1
- data/vendored/puppet/lib/puppet/type/file/checksum.rb +6 -0
- data/vendored/puppet/lib/puppet/type/mount.rb +0 -9
- data/vendored/puppet/lib/puppet/util/character_encoding.rb +2 -2
- data/vendored/puppet/lib/puppet/util/network_device/cisco/device.rb +5 -5
- data/vendored/puppet/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
- data/vendored/puppet/lib/puppet/util/windows/process.rb +1 -1
- data/vendored/puppet/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
- metadata +20 -2
@@ -99,7 +99,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
99
99
|
:VirtualAccess => %w{Virtual-Access Virtual-A Virtual Virt}
|
100
100
|
}
|
101
101
|
|
102
|
-
def
|
102
|
+
def canonicalize_ifname(interface)
|
103
103
|
IF.each do |k,ifnames|
|
104
104
|
if found = ifnames.find { |ifname| interface =~ /^#{ifname}\s*\d/i }
|
105
105
|
found = /^#{found}(.+)\Z/i.match(interface)
|
@@ -119,7 +119,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def interface(name)
|
122
|
-
ifname =
|
122
|
+
ifname = canonicalize_ifname(name)
|
123
123
|
interface = parse_interface(ifname)
|
124
124
|
return { :ensure => :absent } if interface.empty?
|
125
125
|
interface.merge!(parse_trunking(ifname))
|
@@ -127,7 +127,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def new_interface(name)
|
130
|
-
Puppet::Util::NetworkDevice::Cisco::Interface.new(
|
130
|
+
Puppet::Util::NetworkDevice::Cisco::Interface.new(canonicalize_ifname(name), transport)
|
131
131
|
end
|
132
132
|
|
133
133
|
def parse_interface(name)
|
@@ -192,13 +192,13 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
192
192
|
when /^(\d+)\s+(\w+)\s+(\w+)\s+([a-zA-Z0-9,\/. ]+)\s*$/
|
193
193
|
vlan = { :name => $1, :description => $2, :status => $3, :interfaces => [] }
|
194
194
|
if $4.strip.length > 0
|
195
|
-
vlan[:interfaces] = $4.strip.split(/\s*,\s*/).map{ |ifn|
|
195
|
+
vlan[:interfaces] = $4.strip.split(/\s*,\s*/).map{ |ifn| canonicalize_ifname(ifn) }
|
196
196
|
end
|
197
197
|
vlans[vlan[:name]] = vlan
|
198
198
|
when /^\s+([a-zA-Z0-9,\/. ]+)\s*$/
|
199
199
|
raise _("invalid sh vlan summary output") unless vlan
|
200
200
|
if $1.strip.length > 0
|
201
|
-
vlan[:interfaces] += $1.strip.split(/\s*,\s*/).map{ |ifn|
|
201
|
+
vlan[:interfaces] += $1.strip.split(/\s*,\s*/).map{ |ifn| canonicalize_ifname(ifn) }
|
202
202
|
end
|
203
203
|
else
|
204
204
|
end
|
@@ -160,7 +160,7 @@ module Generators
|
|
160
160
|
@allfiles << { "file" => file, "modules" => modules, "classes" => classes, "methods" => methods, "nodes" => nodes }
|
161
161
|
end
|
162
162
|
|
163
|
-
# scan all classes to create the
|
163
|
+
# scan all classes to create the child's references
|
164
164
|
@allclasses.values.each do |klass|
|
165
165
|
if superklass = klass.context.superclass
|
166
166
|
if superklass = AllReferences[superklass] and (superklass.is_a?(HTMLPuppetClass) or superklass.is_a?(HTMLPuppetNode))
|
@@ -232,7 +232,7 @@ module Puppet::Util::Windows::Process
|
|
232
232
|
# Note - Some env variable names start with '=' and are excluded from the return value
|
233
233
|
# Note - The env_ptr MUST be freed using the FreeEnvironmentStringsW function
|
234
234
|
# Note - There is no technical limitation to the size of the environment block returned.
|
235
|
-
# However a
|
235
|
+
# However a practical limit of 64K is used as no single environment variable can exceed 32KB
|
236
236
|
def get_environment_strings
|
237
237
|
env_ptr = GetEnvironmentStringsW()
|
238
238
|
|
@@ -60,7 +60,7 @@ class GitIgnoreSpec < RegexSpec
|
|
60
60
|
pattern_segs.shift
|
61
61
|
else
|
62
62
|
# A pattern without a beginning slash ('/') will match any
|
63
|
-
# descendant path. This is
|
63
|
+
# descendant path. This is equivalent to "**/{pattern}". So,
|
64
64
|
# prepend with double-asterisks to make pattern relative to
|
65
65
|
# root.
|
66
66
|
if pattern_segs.length == 1 && pattern_segs[0] != '**'
|
@@ -70,7 +70,7 @@ class GitIgnoreSpec < RegexSpec
|
|
70
70
|
|
71
71
|
# A pattern ending with a slash ('/') will match all descendant
|
72
72
|
# paths of if it is a directory but not if it is a regular file.
|
73
|
-
# This is
|
73
|
+
# This is equivalent to "{pattern}/**". So, set last segment to
|
74
74
|
# double asterisks to include all descendants.
|
75
75
|
if pattern_segs[-1].empty?
|
76
76
|
pattern_segs[-1] = '**'
|
@@ -185,13 +185,13 @@ class GitIgnoreSpec < RegexSpec
|
|
185
185
|
elsif char == '?'
|
186
186
|
regex += '[^/]'
|
187
187
|
|
188
|
-
#
|
189
|
-
# exclamation mark, the whole
|
188
|
+
# Bracket expression wildcard. Except for the beginning
|
189
|
+
# exclamation mark, the whole bracket expression can be used
|
190
190
|
# directly as regex but we have to find where the expression
|
191
191
|
# ends.
|
192
|
-
# - "[][!]"
|
193
|
-
# - "[]-]"
|
194
|
-
# - "[!]a-]"
|
192
|
+
# - "[][!]" matches ']', '[' and '!'.
|
193
|
+
# - "[]-]" matches ']' and '-'.
|
194
|
+
# - "[!]a-]" matches any character except ']', 'a' and '-'.
|
195
195
|
elsif char == '['
|
196
196
|
j = i
|
197
197
|
# Pass brack expression negation.
|
@@ -199,13 +199,13 @@ class GitIgnoreSpec < RegexSpec
|
|
199
199
|
j += 1
|
200
200
|
end
|
201
201
|
|
202
|
-
# Pass first closing
|
202
|
+
# Pass first closing bracket if it is at the beginning of the
|
203
203
|
# expression.
|
204
204
|
if j < pattern.size && pattern[j].chr == ']'
|
205
205
|
j += 1
|
206
206
|
end
|
207
207
|
|
208
|
-
# Find closing
|
208
|
+
# Find closing bracket. Stop once we reach the end or find it.
|
209
209
|
while j < pattern.size && pattern[j].chr != ']'
|
210
210
|
j += 1
|
211
211
|
end
|
@@ -214,12 +214,12 @@ class GitIgnoreSpec < RegexSpec
|
|
214
214
|
if j < pattern.size
|
215
215
|
expr = '['
|
216
216
|
|
217
|
-
#
|
217
|
+
# Bracket expression needs to be negated.
|
218
218
|
if pattern[i].chr == '!'
|
219
219
|
expr += '^'
|
220
220
|
i += 1
|
221
221
|
|
222
|
-
# POSIX declares that the regex
|
222
|
+
# POSIX declares that the regex bracket expression negation
|
223
223
|
# "[^...]" is undefined in a glob pattern. Python's
|
224
224
|
# `fnmatch.translate()` escapes the caret ('^') as a
|
225
225
|
# literal. To maintain consistency with undefined behavior,
|
@@ -236,26 +236,26 @@ class GitIgnoreSpec < RegexSpec
|
|
236
236
|
end
|
237
237
|
|
238
238
|
|
239
|
-
# Build regex
|
239
|
+
# Build regex bracket expression. Escape slashes so they are
|
240
240
|
# treated as literal slashes by regex as defined by POSIX.
|
241
241
|
expr += pattern[i..j].sub('\\', '\\\\')
|
242
242
|
|
243
|
-
# Add regex
|
243
|
+
# Add regex bracket expression to regex result.
|
244
244
|
regex += expr
|
245
245
|
|
246
|
-
# Found end of
|
247
|
-
# the closing
|
246
|
+
# Found end of bracket expression. Increment j to be one past
|
247
|
+
# the closing bracket:
|
248
248
|
#
|
249
249
|
# [...]
|
250
250
|
# ^ ^
|
251
251
|
# i j
|
252
252
|
#
|
253
253
|
j += 1
|
254
|
-
# Set i to one past the closing
|
254
|
+
# Set i to one past the closing bracket.
|
255
255
|
i = j
|
256
256
|
|
257
|
-
# Failed to find closing
|
258
|
-
#
|
257
|
+
# Failed to find closing bracket, treat opening bracket as a
|
258
|
+
# bracket literal instead of as an expression.
|
259
259
|
else
|
260
260
|
regex += '\['
|
261
261
|
end
|
@@ -161,7 +161,7 @@ module SemanticPuppet
|
|
161
161
|
else
|
162
162
|
# Compare all prerelease identifier segments that can be compared. Should
|
163
163
|
# all segments compare equal up to the point where one of the prereleases
|
164
|
-
# have no more segments, then the one with more
|
164
|
+
# have no more segments, then the one with more segments is greater.
|
165
165
|
your_max = yours.size
|
166
166
|
mine.each_with_index do |x, idx|
|
167
167
|
# 'mine' win if 'your' list of segments is exhausted
|
@@ -181,7 +181,7 @@ module SemanticPuppet
|
|
181
181
|
return cmp unless cmp == 0
|
182
182
|
end
|
183
183
|
|
184
|
-
# All segments, up to the point where at least one list of
|
184
|
+
# All segments, up to the point where at least one list of segment is exhausted,
|
185
185
|
# compared equal. The one with the highest segment count wins.
|
186
186
|
mine.size <=> your_max
|
187
187
|
end
|
@@ -407,8 +407,8 @@ module SemanticPuppet
|
|
407
407
|
|
408
408
|
# Merge two ranges so that the result matches the intersection of all matching versions.
|
409
409
|
#
|
410
|
-
# @param range [
|
411
|
-
# @return [
|
410
|
+
# @param range [AbstractRange] the range to intersect with
|
411
|
+
# @return [AbstractRange,nil] the intersection between the ranges
|
412
412
|
#
|
413
413
|
# @api private
|
414
414
|
def intersection(range)
|
@@ -456,8 +456,8 @@ module SemanticPuppet
|
|
456
456
|
# Merge two ranges so that the result matches the sum of all matching versions. A merge
|
457
457
|
# is only possible when the ranges are either adjacent or have an overlap.
|
458
458
|
#
|
459
|
-
# @param other [
|
460
|
-
# @return [
|
459
|
+
# @param other [AbstractRange] the range to merge with
|
460
|
+
# @return [AbstractRange,nil] the result of the merge
|
461
461
|
#
|
462
462
|
# @api private
|
463
463
|
def merge(other)
|
@@ -508,7 +508,7 @@ module SemanticPuppet
|
|
508
508
|
# Checks if this matcher accepts a prerelease with the same major, minor, patch triple as the given version. Only matchers
|
509
509
|
# where this has been explicitly stated will respond `true` to this method
|
510
510
|
#
|
511
|
-
# @return [Boolean] `true` if this matcher accepts a
|
511
|
+
# @return [Boolean] `true` if this matcher accepts a prerelease with the tuple from the given version
|
512
512
|
def test_prerelease?(_)
|
513
513
|
false
|
514
514
|
end
|
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: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -254,6 +254,20 @@ dependencies:
|
|
254
254
|
- - '='
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: 0.8.8
|
257
|
+
- !ruby/object:Gem::Dependency
|
258
|
+
name: ffi
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - "<="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: 1.9.18
|
264
|
+
type: :runtime
|
265
|
+
prerelease: false
|
266
|
+
version_requirements: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - "<="
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: 1.9.18
|
257
271
|
- !ruby/object:Gem::Dependency
|
258
272
|
name: puppetlabs_spec_helper
|
259
273
|
requirement: !ruby/object:Gem::Requirement
|
@@ -324,6 +338,8 @@ files:
|
|
324
338
|
- lib/bolt/config.rb
|
325
339
|
- lib/bolt/error.rb
|
326
340
|
- lib/bolt/executor.rb
|
341
|
+
- lib/bolt/inventory.rb
|
342
|
+
- lib/bolt/inventory/group.rb
|
327
343
|
- lib/bolt/logger.rb
|
328
344
|
- lib/bolt/node.rb
|
329
345
|
- lib/bolt/node/errors.rb
|
@@ -339,10 +355,12 @@ files:
|
|
339
355
|
- lib/bolt/result.rb
|
340
356
|
- lib/bolt/result_set.rb
|
341
357
|
- lib/bolt/target.rb
|
358
|
+
- lib/bolt/util.rb
|
342
359
|
- lib/bolt/version.rb
|
343
360
|
- modules/boltlib/lib/puppet/datatypes/result.rb
|
344
361
|
- modules/boltlib/lib/puppet/datatypes/resultset.rb
|
345
362
|
- modules/boltlib/lib/puppet/datatypes/target.rb
|
363
|
+
- modules/boltlib/lib/puppet/functions/fail_plan.rb
|
346
364
|
- modules/boltlib/lib/puppet/functions/file_upload.rb
|
347
365
|
- modules/boltlib/lib/puppet/functions/run_command.rb
|
348
366
|
- modules/boltlib/lib/puppet/functions/run_plan.rb
|