bolt 2.32.0 → 2.36.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 +6 -6
- data/bolt-modules/boltlib/lib/puppet/datatypes/applyresult.rb +1 -0
- data/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +1 -3
- data/bolt-modules/boltlib/lib/puppet/functions/download_file.rb +17 -6
- data/bolt-modules/boltlib/lib/puppet/functions/facts.rb +6 -0
- data/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb +56 -0
- data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +2 -2
- data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +24 -6
- data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +27 -8
- data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +21 -1
- data/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +18 -1
- data/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +24 -6
- data/guides/logging.txt +18 -0
- data/lib/bolt/analytics.rb +27 -8
- data/lib/bolt/apply_result.rb +3 -3
- data/lib/bolt/bolt_option_parser.rb +43 -15
- data/lib/bolt/cli.rb +79 -227
- data/lib/bolt/config.rb +131 -52
- data/lib/bolt/config/options.rb +46 -8
- data/lib/bolt/config/transport/base.rb +10 -19
- data/lib/bolt/config/transport/local.rb +0 -7
- data/lib/bolt/config/transport/options.rb +1 -1
- data/lib/bolt/config/transport/ssh.rb +8 -14
- data/lib/bolt/config/validator.rb +231 -0
- data/lib/bolt/error.rb +37 -3
- data/lib/bolt/executor.rb +103 -17
- data/lib/bolt/inventory/group.rb +2 -1
- data/lib/bolt/module_installer.rb +2 -1
- data/lib/bolt/module_installer/specs/forge_spec.rb +5 -4
- data/lib/bolt/module_installer/specs/git_spec.rb +4 -3
- data/lib/bolt/outputter/human.rb +21 -9
- data/lib/bolt/outputter/rainbow.rb +1 -1
- data/lib/bolt/pal.rb +48 -30
- data/lib/bolt/pal/yaml_plan.rb +11 -2
- data/lib/bolt/pal/yaml_plan/evaluator.rb +23 -1
- data/lib/bolt/pal/yaml_plan/loader.rb +14 -9
- data/lib/bolt/plan_creator.rb +160 -0
- data/lib/bolt/plugin.rb +1 -8
- data/lib/bolt/project.rb +30 -36
- data/lib/bolt/project_manager.rb +199 -0
- data/lib/bolt/{project_migrator/config.rb → project_manager/config_migrator.rb} +43 -5
- data/lib/bolt/{project_migrator/inventory.rb → project_manager/inventory_migrator.rb} +5 -5
- data/lib/bolt/{project_migrator/base.rb → project_manager/migrator.rb} +2 -2
- data/lib/bolt/{project_migrator/modules.rb → project_manager/module_migrator.rb} +3 -3
- data/lib/bolt/puppetdb/client.rb +3 -2
- data/lib/bolt/puppetdb/config.rb +9 -8
- data/lib/bolt/result.rb +23 -11
- data/lib/bolt/shell/bash.rb +12 -7
- data/lib/bolt/shell/powershell.rb +12 -7
- data/lib/bolt/task/run.rb +1 -1
- data/lib/bolt/transport/base.rb +18 -18
- data/lib/bolt/transport/docker.rb +23 -6
- data/lib/bolt/transport/orch.rb +23 -19
- data/lib/bolt/transport/orch/connection.rb +10 -3
- data/lib/bolt/transport/remote.rb +3 -3
- data/lib/bolt/transport/simple.rb +6 -6
- data/lib/bolt/transport/ssh/exec_connection.rb +6 -2
- data/lib/bolt/util.rb +19 -7
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt/yarn.rb +23 -0
- data/lib/bolt_server/base_config.rb +3 -1
- data/lib/bolt_server/config.rb +3 -1
- data/lib/bolt_server/file_cache.rb +2 -0
- data/lib/bolt_server/schemas/partials/task.json +2 -2
- data/lib/bolt_server/transport_app.rb +42 -11
- data/lib/bolt_spec/plans/action_stubs/command_stub.rb +1 -1
- data/lib/bolt_spec/plans/action_stubs/script_stub.rb +1 -1
- data/lib/bolt_spec/plans/mock_executor.rb +9 -6
- data/libexec/apply_catalog.rb +1 -1
- data/libexec/custom_facts.rb +1 -1
- data/libexec/query_resources.rb +1 -1
- metadata +12 -14
- data/lib/bolt/project_migrator.rb +0 -80
- data/modules/secure_env_vars/plans/init.pp +0 -20
data/libexec/custom_facts.rb
CHANGED
@@ -51,7 +51,7 @@ Dir.mktmpdir do |puppet_root|
|
|
51
51
|
Puppet::ResourceApi::Transport.inject_device(type, transport)
|
52
52
|
|
53
53
|
Puppet[:facts_terminus] = :network_device
|
54
|
-
Puppet[:certname] = conn_info['
|
54
|
+
Puppet[:certname] = conn_info['name']
|
55
55
|
end
|
56
56
|
|
57
57
|
facts = Puppet::Node::Facts.indirection.find(SecureRandom.uuid, environment: env)
|
data/libexec/query_resources.rb
CHANGED
@@ -59,7 +59,7 @@ Dir.mktmpdir do |puppet_root|
|
|
59
59
|
Puppet::ResourceApi::Transport.inject_device(type, transport)
|
60
60
|
|
61
61
|
Puppet[:facts_terminus] = :network_device
|
62
|
-
Puppet[:certname] = conn_info['
|
62
|
+
Puppet[:certname] = conn_info['name']
|
63
63
|
end
|
64
64
|
|
65
65
|
resources = args['resources'].flat_map do |resource_desc|
|
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.36.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-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -185,9 +185,6 @@ dependencies:
|
|
185
185
|
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: 6.18.0
|
188
|
-
- - "<="
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
version: '6.19'
|
191
188
|
type: :runtime
|
192
189
|
prerelease: false
|
193
190
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -195,9 +192,6 @@ dependencies:
|
|
195
192
|
- - ">="
|
196
193
|
- !ruby/object:Gem::Version
|
197
194
|
version: 6.18.0
|
198
|
-
- - "<="
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '6.19'
|
201
195
|
- !ruby/object:Gem::Dependency
|
202
196
|
name: puppetfile-resolver
|
203
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -404,6 +398,7 @@ files:
|
|
404
398
|
- bolt-modules/boltlib/lib/puppet/functions/get_resources.rb
|
405
399
|
- bolt-modules/boltlib/lib/puppet/functions/get_target.rb
|
406
400
|
- bolt-modules/boltlib/lib/puppet/functions/get_targets.rb
|
401
|
+
- bolt-modules/boltlib/lib/puppet/functions/parallelize.rb
|
407
402
|
- bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb
|
408
403
|
- bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb
|
409
404
|
- bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb
|
@@ -438,6 +433,7 @@ files:
|
|
438
433
|
- bolt-modules/system/lib/puppet/functions/system/env.rb
|
439
434
|
- exe/bolt
|
440
435
|
- guides/inventory.txt
|
436
|
+
- guides/logging.txt
|
441
437
|
- guides/module.txt
|
442
438
|
- guides/modulepath.txt
|
443
439
|
- guides/project.txt
|
@@ -462,6 +458,7 @@ files:
|
|
462
458
|
- lib/bolt/config/transport/remote.rb
|
463
459
|
- lib/bolt/config/transport/ssh.rb
|
464
460
|
- lib/bolt/config/transport/winrm.rb
|
461
|
+
- lib/bolt/config/validator.rb
|
465
462
|
- lib/bolt/error.rb
|
466
463
|
- lib/bolt/executor.rb
|
467
464
|
- lib/bolt/inventory.rb
|
@@ -505,6 +502,7 @@ files:
|
|
505
502
|
- lib/bolt/pal/yaml_plan/step/task.rb
|
506
503
|
- lib/bolt/pal/yaml_plan/step/upload.rb
|
507
504
|
- lib/bolt/pal/yaml_plan/transpiler.rb
|
505
|
+
- lib/bolt/plan_creator.rb
|
508
506
|
- lib/bolt/plan_result.rb
|
509
507
|
- lib/bolt/plugin.rb
|
510
508
|
- lib/bolt/plugin/env_var.rb
|
@@ -513,11 +511,11 @@ files:
|
|
513
511
|
- lib/bolt/plugin/puppetdb.rb
|
514
512
|
- lib/bolt/plugin/task.rb
|
515
513
|
- lib/bolt/project.rb
|
516
|
-
- lib/bolt/
|
517
|
-
- lib/bolt/
|
518
|
-
- lib/bolt/
|
519
|
-
- lib/bolt/
|
520
|
-
- lib/bolt/
|
514
|
+
- lib/bolt/project_manager.rb
|
515
|
+
- lib/bolt/project_manager/config_migrator.rb
|
516
|
+
- lib/bolt/project_manager/inventory_migrator.rb
|
517
|
+
- lib/bolt/project_manager/migrator.rb
|
518
|
+
- lib/bolt/project_manager/module_migrator.rb
|
521
519
|
- lib/bolt/puppetdb.rb
|
522
520
|
- lib/bolt/puppetdb/client.rb
|
523
521
|
- lib/bolt/puppetdb/config.rb
|
@@ -553,6 +551,7 @@ files:
|
|
553
551
|
- lib/bolt/util.rb
|
554
552
|
- lib/bolt/util/puppet_log_level.rb
|
555
553
|
- lib/bolt/version.rb
|
554
|
+
- lib/bolt/yarn.rb
|
556
555
|
- lib/bolt_server/acl.rb
|
557
556
|
- lib/bolt_server/base_config.rb
|
558
557
|
- lib/bolt_server/config.rb
|
@@ -597,7 +596,6 @@ files:
|
|
597
596
|
- modules/canary/lib/puppet/functions/canary/skip.rb
|
598
597
|
- modules/canary/plans/init.pp
|
599
598
|
- modules/puppetdb_fact/plans/init.pp
|
600
|
-
- modules/secure_env_vars/plans/init.pp
|
601
599
|
homepage: https://github.com/puppetlabs/bolt
|
602
600
|
licenses:
|
603
601
|
- Apache-2.0
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bolt/project_migrator/config'
|
4
|
-
require 'bolt/project_migrator/inventory'
|
5
|
-
require 'bolt/project_migrator/modules'
|
6
|
-
|
7
|
-
module Bolt
|
8
|
-
class ProjectMigrator
|
9
|
-
def initialize(config, outputter)
|
10
|
-
@config = config
|
11
|
-
@outputter = outputter
|
12
|
-
end
|
13
|
-
|
14
|
-
def migrate
|
15
|
-
unless $stdin.tty?
|
16
|
-
raise Bolt::Error.new(
|
17
|
-
"stdin is not a tty, unable to migrate project",
|
18
|
-
'bolt/stdin-not-a-tty-error'
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
@outputter.print_message("Migrating project #{@config.project.path}\n\n")
|
23
|
-
|
24
|
-
@outputter.print_action_step(
|
25
|
-
"Migrating a Bolt project may make irreversible changes to the project's "\
|
26
|
-
"configuration and inventory files. Before continuing, make sure the "\
|
27
|
-
"project has a backup or uses a version control system."
|
28
|
-
)
|
29
|
-
|
30
|
-
return 0 unless Bolt::Util.prompt_yes_no("Continue with project migration?", @outputter)
|
31
|
-
|
32
|
-
@outputter.print_message('')
|
33
|
-
|
34
|
-
ok = migrate_inventory && migrate_config && migrate_modules
|
35
|
-
|
36
|
-
if ok
|
37
|
-
@outputter.print_message("Project successfully migrated")
|
38
|
-
else
|
39
|
-
@outputter.print_error("Project could not be migrated completely")
|
40
|
-
end
|
41
|
-
|
42
|
-
ok ? 0 : 1
|
43
|
-
end
|
44
|
-
|
45
|
-
# Migrates the project-level configuration file to the latest version.
|
46
|
-
#
|
47
|
-
private def migrate_config
|
48
|
-
migrator = Bolt::ProjectMigrator::Config.new(@outputter)
|
49
|
-
|
50
|
-
migrator.migrate(
|
51
|
-
@config.project.config_file,
|
52
|
-
@config.project.project_file,
|
53
|
-
@config.inventoryfile || @config.project.inventory_file,
|
54
|
-
@config.project.backup_dir
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
|
-
# Migrates the inventory file to the latest version.
|
59
|
-
#
|
60
|
-
private def migrate_inventory
|
61
|
-
migrator = Bolt::ProjectMigrator::Inventory.new(@outputter)
|
62
|
-
|
63
|
-
migrator.migrate(
|
64
|
-
@config.inventoryfile || @config.project.inventory_file,
|
65
|
-
@config.project.backup_dir
|
66
|
-
)
|
67
|
-
end
|
68
|
-
|
69
|
-
# Migrates the project's modules to use current best practices.
|
70
|
-
#
|
71
|
-
private def migrate_modules
|
72
|
-
migrator = Bolt::ProjectMigrator::Modules.new(@outputter)
|
73
|
-
|
74
|
-
migrator.migrate(
|
75
|
-
@config.project,
|
76
|
-
@config.modulepath
|
77
|
-
)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
plan secure_env_vars(
|
2
|
-
TargetSpec $targets,
|
3
|
-
Optional[String] $command = undef,
|
4
|
-
Optional[String] $script = undef
|
5
|
-
) {
|
6
|
-
$env_vars = parsejson(system::env('BOLT_ENV_VARS'))
|
7
|
-
unless type($command) == Undef or type($script) == Undef {
|
8
|
-
fail_plan('Cannot specify both script and command for secure_env_vars')
|
9
|
-
}
|
10
|
-
|
11
|
-
return if $command {
|
12
|
-
run_command($command, $targets, '_env_vars' => $env_vars)
|
13
|
-
}
|
14
|
-
elsif $script {
|
15
|
-
run_script($script, $targets, '_env_vars' => $env_vars)
|
16
|
-
}
|
17
|
-
else {
|
18
|
-
fail_plan('Must specify either script or command for secure_env_vars')
|
19
|
-
}
|
20
|
-
}
|