bolt 2.15.0 → 2.16.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/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/facts.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/get_target.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/resource.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +2 -1
- data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +2 -1
- data/bolt-modules/boltlib/lib/puppet/functions/set_config.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/set_var.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/vars.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/write_file.rb +1 -0
- data/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb +2 -0
- data/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb +2 -0
- data/bolt-modules/file/lib/puppet/functions/file/exists.rb +1 -0
- data/bolt-modules/file/lib/puppet/functions/file/join.rb +2 -0
- data/bolt-modules/file/lib/puppet/functions/file/read.rb +2 -0
- data/bolt-modules/file/lib/puppet/functions/file/readable.rb +2 -0
- data/bolt-modules/file/lib/puppet/functions/file/write.rb +2 -0
- data/bolt-modules/out/lib/puppet/functions/out/message.rb +2 -0
- data/bolt-modules/prompt/lib/puppet/functions/prompt.rb +1 -0
- data/bolt-modules/system/lib/puppet/functions/system/env.rb +2 -0
- data/lib/bolt/applicator.rb +2 -1
- data/lib/bolt/bolt_option_parser.rb +7 -7
- data/lib/bolt/cli.rb +3 -4
- data/lib/bolt/config.rb +14 -117
- data/lib/bolt/config/options.rb +321 -0
- data/lib/bolt/config/transport/base.rb +16 -16
- data/lib/bolt/config/transport/docker.rb +9 -23
- data/lib/bolt/config/transport/local.rb +6 -44
- data/lib/bolt/config/transport/options.rb +305 -0
- data/lib/bolt/config/transport/orch.rb +9 -18
- data/lib/bolt/config/transport/remote.rb +3 -6
- data/lib/bolt/config/transport/ssh.rb +55 -149
- data/lib/bolt/config/transport/winrm.rb +18 -47
- data/lib/bolt/inventory/group.rb +1 -1
- data/lib/bolt/inventory/inventory.rb +0 -14
- data/lib/bolt/inventory/target.rb +18 -5
- data/lib/bolt/pal.rb +3 -1
- data/lib/bolt/project.rb +21 -38
- data/lib/bolt/shell/bash.rb +9 -9
- data/lib/bolt/shell/powershell.rb +2 -1
- data/lib/bolt/transport/docker.rb +1 -1
- data/lib/bolt/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4472049678531606c70c32415b9fde26f897fae21ffdf4099b01fd301f1dff57
|
4
|
+
data.tar.gz: 305f69f3690a8a6b5468a57f7a5af8142fa90bf24a72499dc9f06094e007c1b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af09bca7283a90b7644926048e178778778df5f333998a43719b37353fc5d7fd396212d8a65fcc3644c203189ab7cef6e5799b360f83caff08b879d9aef70dfa
|
7
|
+
data.tar.gz: 314cfdee1be67a5fa1fe67211081973c8f52999cd4915440c28ecd0a76d880b73051d67dcb73068b3155e731d668bc6e0060a47eb4fd0394f8b254e56a3668c7
|
@@ -29,6 +29,7 @@ Puppet::Functions.create_function(:add_to_group) do
|
|
29
29
|
|
30
30
|
inventory = Puppet.lookup(:bolt_inventory)
|
31
31
|
executor = Puppet.lookup(:bolt_executor)
|
32
|
+
# Send Analytics Report
|
32
33
|
executor.report_function_call(self.class.name)
|
33
34
|
|
34
35
|
inventory.add_to_group(inventory.get_targets(targets), group)
|
@@ -17,6 +17,7 @@ Puppet::Functions.create_function(:facts) do
|
|
17
17
|
inventory = Puppet.lookup(:bolt_inventory)
|
18
18
|
# Bolt executor not expected when invoked from apply block
|
19
19
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
20
|
+
# Send Analytics Report
|
20
21
|
executor&.report_function_call(self.class.name)
|
21
22
|
|
22
23
|
inventory.facts(target)
|
@@ -40,6 +40,7 @@ Puppet::Functions.create_function(:fail_plan) do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
executor = Puppet.lookup(:bolt_executor)
|
43
|
+
# Send Analytics Report
|
43
44
|
executor.report_function_call(self.class.name)
|
44
45
|
|
45
46
|
raise Bolt::PlanFailure.new(msg, kind || 'bolt/plan-failure', details, issue_code)
|
@@ -21,6 +21,7 @@ Puppet::Functions.create_function(:get_target) do
|
|
21
21
|
inventory = Puppet.lookup(:bolt_inventory)
|
22
22
|
# Bolt executor not expected when invoked from apply block
|
23
23
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
24
|
+
# Send Analytics Report
|
24
25
|
executor&.report_function_call(self.class.name)
|
25
26
|
|
26
27
|
unless inventory.version > 1
|
@@ -27,6 +27,7 @@ Puppet::Functions.create_function(:get_targets) do
|
|
27
27
|
inventory = Puppet.lookup(:bolt_inventory)
|
28
28
|
# Bolt executor not expected when invoked from apply block
|
29
29
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
30
|
+
# Send Analytics Report
|
30
31
|
executor&.report_function_call(self.class.name)
|
31
32
|
|
32
33
|
inventory.get_targets(names)
|
@@ -20,6 +20,7 @@ Puppet::Functions.create_function(:puppetdb_fact) do
|
|
20
20
|
puppetdb_client = Puppet.lookup(:bolt_pdb_client)
|
21
21
|
# Bolt executor not expected when invoked from apply block
|
22
22
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
23
|
+
# Send Analytics Report
|
23
24
|
executor&.report_function_call(self.class.name)
|
24
25
|
|
25
26
|
puppetdb_client.facts_for_node(certnames)
|
@@ -22,6 +22,7 @@ Puppet::Functions.create_function(:puppetdb_query) do
|
|
22
22
|
puppetdb_client = Puppet.lookup(:bolt_pdb_client)
|
23
23
|
# Bolt executor not expected when invoked from apply block
|
24
24
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
25
|
+
# Send Analytics Report
|
25
26
|
executor&.report_function_call(self.class.name)
|
26
27
|
|
27
28
|
puppetdb_client.make_query(query)
|
@@ -31,6 +31,7 @@ Puppet::Functions.create_function(:remove_from_group) do
|
|
31
31
|
|
32
32
|
inventory = Puppet.lookup(:bolt_inventory)
|
33
33
|
executor = Puppet.lookup(:bolt_executor)
|
34
|
+
# Send Analytics Report
|
34
35
|
executor.report_function_call(self.class.name)
|
35
36
|
|
36
37
|
inventory.remove_from_group(inventory.get_targets(target), group)
|
@@ -41,6 +41,7 @@ Puppet::Functions.create_function(:resource) do
|
|
41
41
|
def resource(target, type, title)
|
42
42
|
inventory = Puppet.lookup(:bolt_inventory)
|
43
43
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
44
|
+
# Send Analytics Report
|
44
45
|
executor&.report_function_call(self.class.name)
|
45
46
|
|
46
47
|
inventory.resource(target, type, title)
|
@@ -57,6 +57,7 @@ Puppet::Functions.create_function(:run_command) do
|
|
57
57
|
executor = Puppet.lookup(:bolt_executor)
|
58
58
|
inventory = Puppet.lookup(:bolt_inventory)
|
59
59
|
|
60
|
+
# Send Analytics Report
|
60
61
|
executor.report_function_call(self.class.name)
|
61
62
|
|
62
63
|
# Ensure that given targets are all Target instances
|
@@ -64,10 +64,11 @@ Puppet::Functions.create_function(:run_plan, Puppet::Functions::InternalFunction
|
|
64
64
|
# Bolt calls this function internally to trigger plans from the CLI. We
|
65
65
|
# don't want to count those invocations.
|
66
66
|
unless options[:bolt_api_call]
|
67
|
+
# Send Analytics Report
|
67
68
|
executor.report_function_call(self.class.name)
|
68
69
|
end
|
69
70
|
|
70
|
-
# Report bundled content, this should capture plans run from both CLI and Plans
|
71
|
+
# Send Analytics Report for bundled content, this should capture plans run from both CLI and Plans
|
71
72
|
executor.report_bundled_content('Plan', plan_name)
|
72
73
|
|
73
74
|
loaders = closure_scope.compiler.loaders
|
@@ -64,6 +64,7 @@ Puppet::Functions.create_function(:run_script, Puppet::Functions::InternalFuncti
|
|
64
64
|
executor = Puppet.lookup(:bolt_executor)
|
65
65
|
inventory = Puppet.lookup(:bolt_inventory)
|
66
66
|
|
67
|
+
# Send Analytics Report
|
67
68
|
executor.report_function_call(self.class.name)
|
68
69
|
|
69
70
|
found = Puppet::Parser::Files.find_file(script, scope.compiler.environment)
|
@@ -64,10 +64,11 @@ Puppet::Functions.create_function(:run_task) do
|
|
64
64
|
# Bolt calls this function internally to trigger tasks from the CLI. We
|
65
65
|
# don't want to count those invocations.
|
66
66
|
unless options[:bolt_api_call]
|
67
|
+
# Send Analytics Report
|
67
68
|
executor.report_function_call(self.class.name)
|
68
69
|
end
|
69
70
|
|
70
|
-
# Report bundled content, this should capture tasks run from both CLI and Plans
|
71
|
+
# Report Analytics for bundled content, this should capture tasks run from both CLI and Plans
|
71
72
|
executor.report_bundled_content('Task', task_name)
|
72
73
|
|
73
74
|
# Ensure that given targets are all Target instances
|
@@ -33,6 +33,7 @@ Puppet::Functions.create_function(:set_feature) do
|
|
33
33
|
|
34
34
|
inventory = Puppet.lookup(:bolt_inventory)
|
35
35
|
executor = Puppet.lookup(:bolt_executor)
|
36
|
+
# Send Analytics Report
|
36
37
|
executor.report_function_call(self.class.name)
|
37
38
|
|
38
39
|
inventory.set_feature(target, feature, value)
|
@@ -67,6 +67,7 @@ Puppet::Functions.create_function(:upload_file, Puppet::Functions::InternalFunct
|
|
67
67
|
executor = Puppet.lookup(:bolt_executor)
|
68
68
|
inventory = Puppet.lookup(:bolt_inventory)
|
69
69
|
|
70
|
+
# Send Analytics Report
|
70
71
|
executor.report_function_call(self.class.name)
|
71
72
|
|
72
73
|
found = Puppet::Parser::Files.find_file(source, scope.compiler.environment)
|
@@ -21,6 +21,7 @@ Puppet::Functions.create_function(:vars) do
|
|
21
21
|
inventory = Puppet.lookup(:bolt_inventory)
|
22
22
|
# Bolt executor not expected when invoked from apply block
|
23
23
|
executor = Puppet.lookup(:bolt_executor) { nil }
|
24
|
+
# Send Analytics Report
|
24
25
|
executor&.report_function_call(self.class.name)
|
25
26
|
|
26
27
|
inventory.vars(target)
|
@@ -33,6 +33,7 @@ Puppet::Functions.create_function(:wait_until_available) do
|
|
33
33
|
executor = Puppet.lookup(:bolt_executor)
|
34
34
|
inventory = Puppet.lookup(:bolt_inventory)
|
35
35
|
|
36
|
+
# Send Analytics Report
|
36
37
|
executor.report_function_call(self.class.name)
|
37
38
|
|
38
39
|
# Ensure that given targets are all Target instances
|
@@ -20,7 +20,9 @@ Puppet::Functions.create_function(:'ctrl::do_until') do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def do_until(options = { 'limit' => 0 })
|
23
|
+
# Send Analytics Report
|
23
24
|
Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
|
25
|
+
|
24
26
|
limit = options['limit']
|
25
27
|
i = 0
|
26
28
|
until (x = yield)
|
@@ -17,6 +17,7 @@ Puppet::Functions.create_function(:'file::exists', Puppet::Functions::InternalFu
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def exists(scope, filename)
|
20
|
+
# Send Analytics Report
|
20
21
|
Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
|
21
22
|
found = Puppet::Parser::Files.find_file(filename, scope.compiler.environment)
|
22
23
|
found ? Puppet::FileSystem.exist?(found) : false
|
@@ -16,7 +16,9 @@ Puppet::Functions.create_function(:'file::read', Puppet::Functions::InternalFunc
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def read(scope, filename)
|
19
|
+
# Send Analytics Report
|
19
20
|
Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
|
21
|
+
|
20
22
|
found = Puppet::Parser::Files.find_file(filename, scope.compiler.environment)
|
21
23
|
unless found && Puppet::FileSystem.exist?(found)
|
22
24
|
raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
|
@@ -17,7 +17,9 @@ Puppet::Functions.create_function(:'file::readable', Puppet::Functions::Internal
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def readable(scope, filename)
|
20
|
+
# Send Analytics Report
|
20
21
|
Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
|
22
|
+
|
21
23
|
found = Puppet::Parser::Files.find_file(filename, scope.compiler.environment)
|
22
24
|
found ? File.readable?(found) : false
|
23
25
|
end
|
@@ -23,7 +23,9 @@ Puppet::Functions.create_function(:'out::message') do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
executor = Puppet.lookup(:bolt_executor)
|
26
|
+
# Send Analytics Report
|
26
27
|
executor.report_function_call(self.class.name)
|
28
|
+
|
27
29
|
executor.publish_event(type: :message, message: message)
|
28
30
|
|
29
31
|
nil
|
@@ -30,6 +30,7 @@ Puppet::Functions.create_function(:prompt) do
|
|
30
30
|
options = options.transform_keys(&:to_sym)
|
31
31
|
|
32
32
|
executor = Puppet.lookup(:bolt_executor)
|
33
|
+
# Send analytics report
|
33
34
|
executor.report_function_call(self.class.name)
|
34
35
|
|
35
36
|
response = executor.prompt(prompt, options)
|
data/lib/bolt/applicator.rb
CHANGED
@@ -196,10 +196,11 @@ module Bolt
|
|
196
196
|
type_by_reference: true,
|
197
197
|
local_reference: true)
|
198
198
|
|
199
|
+
bolt_project = @project if @project&.name
|
199
200
|
scope = {
|
200
201
|
code_ast: ast,
|
201
202
|
modulepath: @modulepath,
|
202
|
-
project:
|
203
|
+
project: bolt_project.to_h,
|
203
204
|
pdb_config: @pdb_client.config.to_hash,
|
204
205
|
hiera_config: @hiera_config,
|
205
206
|
plan_vars: plan_vars,
|
@@ -10,7 +10,7 @@ module Bolt
|
|
10
10
|
authentication: %w[user password password-prompt private-key host-key-check ssl ssl-verify],
|
11
11
|
escalation: %w[run-as sudo-password sudo-password-prompt sudo-executable],
|
12
12
|
run_context: %w[concurrency inventoryfile save-rerun cleanup],
|
13
|
-
global_config_setters: %w[modulepath
|
13
|
+
global_config_setters: %w[modulepath project configfile],
|
14
14
|
transports: %w[transport connect-timeout tty ssh-command copy-command],
|
15
15
|
display: %w[format color verbose trace],
|
16
16
|
global: %w[help version debug] }.freeze
|
@@ -422,7 +422,7 @@ module Bolt
|
|
422
422
|
|
423
423
|
ACTIONS
|
424
424
|
generate-types Generate type references to register in plans
|
425
|
-
install Install modules from a Puppetfile into a
|
425
|
+
install Install modules from a Puppetfile into a project
|
426
426
|
show-modules List modules available to the Bolt project
|
427
427
|
HELP
|
428
428
|
|
@@ -445,7 +445,7 @@ module Bolt
|
|
445
445
|
bolt puppetfile install [options]
|
446
446
|
|
447
447
|
DESCRIPTION
|
448
|
-
Install modules from a Puppetfile into a
|
448
|
+
Install modules from a Puppetfile into a project
|
449
449
|
HELP
|
450
450
|
|
451
451
|
PUPPETFILE_SHOWMODULES_HELP = <<~HELP
|
@@ -709,13 +709,13 @@ module Bolt
|
|
709
709
|
File.expand_path(moduledir)
|
710
710
|
end
|
711
711
|
end
|
712
|
-
define('--boltdir FILEPATH',
|
713
|
-
'Specify what
|
712
|
+
define('--project FILEPATH', '--boltdir FILEPATH',
|
713
|
+
'Specify what project to load config from (default: autodiscovered from current working dir)') do |path|
|
714
714
|
@options[:boltdir] = path
|
715
715
|
end
|
716
716
|
define('--configfile FILEPATH',
|
717
717
|
'Specify where to load config from (default: ~/.puppetlabs/bolt/bolt.yaml).',
|
718
|
-
'Directory containing bolt.yaml will be used as the
|
718
|
+
'Directory containing bolt.yaml will be used as the project directory.') do |path|
|
719
719
|
@options[:configfile] = path
|
720
720
|
end
|
721
721
|
define('--hiera-config FILEPATH',
|
@@ -731,7 +731,7 @@ module Bolt
|
|
731
731
|
end
|
732
732
|
define('--puppetfile FILEPATH',
|
733
733
|
'Specify a Puppetfile to use when installing modules. (default: ~/.puppetlabs/bolt/Puppetfile)',
|
734
|
-
'Modules are installed in the current
|
734
|
+
'Modules are installed in the current project.') do |path|
|
735
735
|
@options[:puppetfile_path] = Pathname.new(File.expand_path(path))
|
736
736
|
end
|
737
737
|
define('--[no-]save-rerun', 'Whether to update the rerun file after this command.') do |save|
|
data/lib/bolt/cli.rb
CHANGED
@@ -219,7 +219,7 @@ module Bolt
|
|
219
219
|
end
|
220
220
|
|
221
221
|
if options[:boltdir] && options[:configfile]
|
222
|
-
raise Bolt::CLIError, "Only one of '--boltdir' or '--configfile' may be specified"
|
222
|
+
raise Bolt::CLIError, "Only one of '--boltdir', '--project', or '--configfile' may be specified"
|
223
223
|
end
|
224
224
|
|
225
225
|
if options[:noop] &&
|
@@ -513,7 +513,7 @@ module Bolt
|
|
513
513
|
plan_context[:description] = options[:description] if options[:description]
|
514
514
|
|
515
515
|
executor = Bolt::Executor.new(config.concurrency, analytics, options[:noop], config.modified_concurrency)
|
516
|
-
if options.fetch(:format, 'human')
|
516
|
+
if %w[human rainbow].include?(options.fetch(:format, 'human'))
|
517
517
|
executor.subscribe(outputter)
|
518
518
|
else
|
519
519
|
# Only subscribe to out::message events for JSON outputter
|
@@ -771,14 +771,13 @@ module Bolt
|
|
771
771
|
end
|
772
772
|
|
773
773
|
def pal
|
774
|
-
project = config.project.project_file? ? config.project : nil
|
775
774
|
@pal ||= Bolt::PAL.new(config.modulepath,
|
776
775
|
config.hiera_config,
|
777
776
|
config.project.resource_types,
|
778
777
|
config.compile_concurrency,
|
779
778
|
config.trusted_external,
|
780
779
|
config.apply_settings,
|
781
|
-
project)
|
780
|
+
config.project)
|
782
781
|
end
|
783
782
|
|
784
783
|
def convert_plan(plan)
|