bolt 3.21.0 → 3.22.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/lib/bolt/config/options.rb +8 -0
- data/lib/bolt/module.rb +6 -0
- data/lib/bolt/plugin/env_var.rb +17 -1
- data/lib/bolt/plugin/puppetdb.rb +7 -0
- data/lib/bolt/project.rb +4 -0
- data/lib/bolt/transport/ssh/exec_connection.rb +5 -2
- data/lib/bolt/util.rb +1 -1
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_server/transport_app.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5ed54ef60335c8ef24f0e5c76b3dbb669d2e4c83a36744d8d2efe090c2b72b0
|
4
|
+
data.tar.gz: 703e8adaa6f23ae4ac180370f4905844cb573b37c5449066e110167095fe15e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dfb2cf0b51cf238193d4e7b86933010d05a4985bc4df010c80dbcb9f8117d6dbb4359e81bacde3d567f61aae3b986d1d2e8c0c76a466c26a298bdc41c925bbf
|
7
|
+
data.tar.gz: fad359e9877901bebf721f2945425c62815bccfd5564125c45a545f3e45907d7fcb81a7d670c8cc54585596e173a4ebc960db5601495d69cebc0b5f449b368e1
|
data/lib/bolt/config/options.rb
CHANGED
@@ -461,6 +461,13 @@ module Bolt
|
|
461
461
|
},
|
462
462
|
_plugin: true
|
463
463
|
},
|
464
|
+
"rerunfile" => {
|
465
|
+
description: "The path to the project's rerun file. The rerun file is used to store information "\
|
466
|
+
"about targets from the most recent run. Expands relative to the project directory.",
|
467
|
+
type: String,
|
468
|
+
_example: "/Users/bolt/project/rerun.json",
|
469
|
+
_plugin: true
|
470
|
+
},
|
464
471
|
"save-rerun" => {
|
465
472
|
description: "Whether to update `.rerun.json` in the Bolt project directory. If "\
|
466
473
|
"your target names include passwords, set this value to `false` to avoid "\
|
@@ -630,6 +637,7 @@ module Bolt
|
|
630
637
|
plugins
|
631
638
|
policies
|
632
639
|
puppetdb
|
640
|
+
rerunfile
|
633
641
|
save-rerun
|
634
642
|
spinner
|
635
643
|
stream
|
data/lib/bolt/module.rb
CHANGED
@@ -42,6 +42,12 @@ module Bolt
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def plugin?
|
45
|
+
if File.exist?(File.join(path, 'bolt-plugin.json'))
|
46
|
+
msg = "Found bolt-plugin.json in module #{name} at #{path}. Bolt looks for " \
|
47
|
+
"bolt_plugin.json to determine if the module contains plugins. " \
|
48
|
+
"Rename the file for Bolt to recognize it."
|
49
|
+
Bolt::Logger.warn_once('plugin_file_name', msg)
|
50
|
+
end
|
45
51
|
File.exist?(plugin_data_file)
|
46
52
|
end
|
47
53
|
end
|
data/lib/bolt/plugin/env_var.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'json'
|
3
4
|
module Bolt
|
4
5
|
class Plugin
|
5
6
|
class EnvVar
|
7
|
+
class InvalidPluginData < Bolt::Plugin::PluginError
|
8
|
+
def initialize(msg, plugin)
|
9
|
+
msg = "Invalid Plugin Data for #{plugin}: #{msg}"
|
10
|
+
super(msg, 'bolt/invalid-plugin-data')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
6
14
|
def initialize(*_args); end
|
7
15
|
|
8
16
|
def name
|
@@ -31,7 +39,15 @@ module Bolt
|
|
31
39
|
end
|
32
40
|
|
33
41
|
def resolve_reference(opts)
|
34
|
-
ENV[opts['var']]
|
42
|
+
reference = ENV[opts['var']]
|
43
|
+
if opts['json'] && reference
|
44
|
+
begin
|
45
|
+
reference = JSON.parse(reference)
|
46
|
+
rescue JSON::ParserError => e
|
47
|
+
raise InvalidPluginData.new(e.message, name)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
reference || opts['default']
|
35
51
|
end
|
36
52
|
end
|
37
53
|
end
|
data/lib/bolt/plugin/puppetdb.rb
CHANGED
@@ -42,6 +42,13 @@ module Bolt
|
|
42
42
|
|
43
43
|
def fact_path(raw_fact)
|
44
44
|
fact_path = raw_fact.split(".")
|
45
|
+
fact_path = fact_path.map do |segment|
|
46
|
+
# Turn it into an integer if we can
|
47
|
+
Integer(segment)
|
48
|
+
rescue ArgumentError
|
49
|
+
# Otherwise return the value
|
50
|
+
segment
|
51
|
+
end
|
45
52
|
if fact_path[0] == 'facts'
|
46
53
|
fact_path.drop(1)
|
47
54
|
elsif fact_path == ['certname']
|
data/lib/bolt/project.rb
CHANGED
@@ -44,11 +44,12 @@ module Bolt
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def ssh_opts
|
47
|
+
# NOTE: not all commands we might use here support various `-o` options,
|
48
|
+
# always provide a way to run without them.
|
47
49
|
cmd = []
|
48
50
|
# BatchMode is SSH's noninteractive option: if key authentication
|
49
51
|
# fails it will error out instead of falling back to password prompt
|
50
|
-
|
51
|
-
cmd += %W[-o BatchMode=#{batch_mode}]
|
52
|
+
cmd += %w[-o BatchMode=yes] if @target.transport_config['batch-mode']
|
52
53
|
|
53
54
|
cmd += %W[-o Port=#{@target.port}] if @target.port
|
54
55
|
|
@@ -68,6 +69,8 @@ module Bolt
|
|
68
69
|
ssh_cmd = Array(ssh_conf)
|
69
70
|
ssh_cmd += ssh_opts
|
70
71
|
ssh_cmd << userhost
|
72
|
+
# Add option separator before command for wrappers around SSH
|
73
|
+
ssh_cmd << '--'
|
71
74
|
ssh_cmd << command
|
72
75
|
end
|
73
76
|
|
data/lib/bolt/util.rb
CHANGED
@@ -344,7 +344,7 @@ module Bolt
|
|
344
344
|
|
345
345
|
if !stat.readable?
|
346
346
|
raise Bolt::FileError.new("The #{type} '#{path}' is unreadable", path)
|
347
|
-
elsif !
|
347
|
+
elsif !allow_dir && stat.directory?
|
348
348
|
expected = allow_dir ? 'file or directory' : 'file'
|
349
349
|
raise Bolt::FileError.new("The #{type} '#{path}' is not a #{expected}", path)
|
350
350
|
elsif stat.directory?
|
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.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -673,7 +673,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
673
673
|
- !ruby/object:Gem::Version
|
674
674
|
version: '0'
|
675
675
|
requirements: []
|
676
|
-
rubygems_version: 3.0.
|
676
|
+
rubygems_version: 3.0.9
|
677
677
|
signing_key:
|
678
678
|
specification_version: 4
|
679
679
|
summary: Execute commands remotely over SSH and WinRM
|