openbolt 5.6.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Puppetfile +35 -35
- data/bolt-modules/boltlib/lib/puppet/datatypes/result.rb +1 -1
- data/bolt-modules/boltlib/lib/puppet/datatypes/resultset.rb +2 -2
- data/bolt-modules/boltlib/lib/puppet/datatypes/target.rb +2 -2
- data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +2 -2
- data/bolt-modules/boltlib/lib/puppet/functions/background.rb +1 -1
- data/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb +1 -1
- data/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb +1 -1
- data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb +1 -1
- data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +1 -1
- data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +27 -4
- data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +14 -22
- data/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +14 -26
- data/bolt-modules/boltlib/lib/puppet/functions/wait.rb +2 -2
- data/bolt-modules/file/lib/puppet/functions/file/delete.rb +1 -1
- data/bolt-modules/file/lib/puppet/functions/file/exists.rb +1 -1
- data/bolt-modules/file/lib/puppet/functions/file/read.rb +1 -1
- data/bolt-modules/file/lib/puppet/functions/file/readable.rb +1 -1
- data/bolt-modules/file/lib/puppet/functions/file/write.rb +1 -1
- data/bolt-modules/log/lib/puppet/functions/log/debug.rb +1 -1
- data/bolt-modules/log/lib/puppet/functions/log/error.rb +1 -1
- data/bolt-modules/log/lib/puppet/functions/log/fatal.rb +1 -1
- data/bolt-modules/log/lib/puppet/functions/log/info.rb +1 -1
- data/bolt-modules/log/lib/puppet/functions/log/trace.rb +1 -1
- data/bolt-modules/log/lib/puppet/functions/log/warn.rb +1 -1
- data/guides/debugging.yaml +1 -1
- data/guides/inventory.yaml +2 -2
- data/guides/links.yaml +18 -9
- data/guides/logging.yaml +1 -1
- data/guides/module.yaml +1 -1
- data/guides/modulepath.yaml +1 -1
- data/guides/project.yaml +2 -2
- data/guides/targets.yaml +3 -1
- data/guides/transports.yaml +4 -3
- data/lib/bolt/analytics.rb +2 -10
- data/lib/bolt/bolt_option_parser.rb +66 -66
- data/lib/bolt/cli.rb +21 -2
- data/lib/bolt/config/options.rb +18 -18
- data/lib/bolt/config/transport/choria.rb +3 -0
- data/lib/bolt/config/transport/options.rb +34 -45
- data/lib/bolt/executor.rb +4 -0
- data/lib/bolt/fiber_executor.rb +46 -2
- data/lib/bolt/inventory/options.rb +1 -1
- data/lib/bolt/inventory/target.rb +1 -1
- data/lib/bolt/module_installer/puppetfile.rb +1 -1
- data/lib/bolt/module_installer/specs.rb +1 -1
- data/lib/bolt/outputter/human.rb +1 -2
- data/lib/bolt/plan_creator.rb +4 -4
- data/lib/bolt/plan_future.rb +5 -1
- data/lib/bolt/project_manager/inventory_migrator.rb +1 -1
- data/lib/bolt/project_manager/module_migrator.rb +1 -1
- data/lib/bolt/project_manager.rb +1 -1
- data/lib/bolt/shell/bash.rb +7 -4
- data/lib/bolt/shell/powershell/snippets.rb +20 -1
- data/lib/bolt/shell/powershell.rb +2 -2
- data/lib/bolt/transport/base.rb +9 -4
- data/lib/bolt/transport/choria/agent_discovery.rb +32 -14
- data/lib/bolt/transport/choria/bolt_tasks.rb +64 -40
- data/lib/bolt/transport/choria/client.rb +66 -49
- data/lib/bolt/transport/choria/command_builders.rb +144 -24
- data/lib/bolt/transport/choria/file_transfer.rb +134 -0
- data/lib/bolt/transport/choria/helpers.rb +25 -20
- data/lib/bolt/transport/choria/shell.rb +255 -148
- data/lib/bolt/transport/choria.rb +96 -27
- data/lib/bolt/transport/ssh/connection.rb +2 -1
- data/lib/bolt/util.rb +13 -0
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_spec/plans/mock_executor.rb +4 -0
- data/libexec/apply_catalog.rb +3 -0
- metadata +22 -7
data/lib/bolt/analytics.rb
CHANGED
|
@@ -82,16 +82,8 @@ module Bolt
|
|
|
82
82
|
if File.exist?(filename)
|
|
83
83
|
Bolt::Util.read_optional_yaml_hash(filename, 'analytics')
|
|
84
84
|
else
|
|
85
|
-
#
|
|
86
|
-
|
|
87
|
-
msg = <<~ANALYTICS
|
|
88
|
-
Bolt collects data about how you use it. You can opt out of providing this data.
|
|
89
|
-
To learn how to disable data collection, or see what data Bolt collects and why,
|
|
90
|
-
see http://pup.pt/bolt-analytics
|
|
91
|
-
ANALYTICS
|
|
92
|
-
Bolt::Logger.warn_once('analytics_opt_out', msg)
|
|
93
|
-
end
|
|
94
|
-
|
|
85
|
+
# Analytics are disabled in this fork, so there is nothing to opt out of.
|
|
86
|
+
# If analytics are revived for Vox, restore an opt-out notice here.
|
|
95
87
|
{}
|
|
96
88
|
end
|
|
97
89
|
end
|
|
@@ -216,21 +216,21 @@ module Bolt
|
|
|
216
216
|
command Run a command remotely
|
|
217
217
|
file Copy files between the controller and targets
|
|
218
218
|
group Show the list of groups in the inventory
|
|
219
|
-
guide View guides for
|
|
219
|
+
guide View guides for OpenBolt concepts and features
|
|
220
220
|
inventory Show the list of targets an action would run on
|
|
221
|
-
module Manage
|
|
221
|
+
module Manage OpenBolt project modules
|
|
222
222
|
lookup Look up a value with Hiera
|
|
223
|
-
plan Convert, create, show, and run
|
|
223
|
+
plan Convert, create, show, and run plans
|
|
224
224
|
plugin Show available plugins
|
|
225
225
|
policy Apply, create, and show policies
|
|
226
|
-
project Create and migrate
|
|
226
|
+
project Create and migrate OpenBolt projects
|
|
227
227
|
script Upload a local script and run it remotely
|
|
228
228
|
secret Create encryption keys and encrypt and decrypt values
|
|
229
|
-
task Show and run
|
|
229
|
+
task Show and run tasks
|
|
230
230
|
|
|
231
231
|
#{colorize(:cyan, 'Guides')}
|
|
232
|
-
For a list of guides on
|
|
233
|
-
Find
|
|
232
|
+
For a list of guides on OpenBolt's concepts and features, run 'bolt guide'.
|
|
233
|
+
Find OpenBolt's documentation at https://docs.openvoxproject.org/openbolt/latest/.
|
|
234
234
|
HELP
|
|
235
235
|
|
|
236
236
|
APPLY_HELP = <<~HELP
|
|
@@ -245,7 +245,7 @@ module Bolt
|
|
|
245
245
|
Apply Puppet manifest code on the specified targets.
|
|
246
246
|
|
|
247
247
|
#{colorize(:cyan, 'Documentation')}
|
|
248
|
-
For documentation see
|
|
248
|
+
For documentation see https://docs.openvoxproject.org/openbolt/latest/applying_manifest_blocks.html.
|
|
249
249
|
|
|
250
250
|
#{colorize(:cyan, 'Examples')}
|
|
251
251
|
bolt apply manifest.pp -t target
|
|
@@ -263,7 +263,7 @@ module Bolt
|
|
|
263
263
|
Run a command on the specified targets.
|
|
264
264
|
|
|
265
265
|
#{colorize(:cyan, 'Documentation')}
|
|
266
|
-
For documentation see
|
|
266
|
+
For documentation see https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
267
267
|
|
|
268
268
|
#{colorize(:cyan, 'Actions')}
|
|
269
269
|
run Run a command on the specified targets.
|
|
@@ -281,7 +281,7 @@ module Bolt
|
|
|
281
281
|
Run a command on the specified targets.
|
|
282
282
|
|
|
283
283
|
#{colorize(:cyan, 'Documentation')}
|
|
284
|
-
For documentation see
|
|
284
|
+
For documentation see https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
285
285
|
|
|
286
286
|
#{colorize(:cyan, 'Examples')}
|
|
287
287
|
bolt command run 'uptime' -t target1,target2
|
|
@@ -298,7 +298,7 @@ module Bolt
|
|
|
298
298
|
Copy files and directories between the controller and targets.
|
|
299
299
|
|
|
300
300
|
#{colorize(:cyan, 'Documentation')}
|
|
301
|
-
For documentation see
|
|
301
|
+
For documentation see https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
302
302
|
|
|
303
303
|
#{colorize(:cyan, 'Actions')}
|
|
304
304
|
download Download a file or directory to the controller
|
|
@@ -322,7 +322,7 @@ module Bolt
|
|
|
322
322
|
subdirectory of the project directory.
|
|
323
323
|
|
|
324
324
|
#{colorize(:cyan, 'Documentation')}
|
|
325
|
-
For documentation see
|
|
325
|
+
For documentation see https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
326
326
|
|
|
327
327
|
#{colorize(:cyan, 'Examples')}
|
|
328
328
|
bolt file download /etc/ssh_config ssh_config -t all
|
|
@@ -340,7 +340,7 @@ module Bolt
|
|
|
340
340
|
Upload a local file or directory.
|
|
341
341
|
|
|
342
342
|
#{colorize(:cyan, 'Documentation')}
|
|
343
|
-
For documentation see
|
|
343
|
+
For documentation see https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
344
344
|
|
|
345
345
|
#{colorize(:cyan, 'Examples')}
|
|
346
346
|
bolt file upload /tmp/source /etc/profile.d/login.sh -t target1
|
|
@@ -385,7 +385,7 @@ module Bolt
|
|
|
385
385
|
bolt guide [topic] [options]
|
|
386
386
|
|
|
387
387
|
#{colorize(:cyan, 'Description')}
|
|
388
|
-
View guides for
|
|
388
|
+
View guides for OpenBolt's concepts and features.
|
|
389
389
|
|
|
390
390
|
Omitting a topic will display a list of available guides,
|
|
391
391
|
while providing a topic will display the relevant guide.
|
|
@@ -445,7 +445,7 @@ module Bolt
|
|
|
445
445
|
Look up a value with Hiera.
|
|
446
446
|
|
|
447
447
|
#{colorize(:cyan, 'Documentation')}
|
|
448
|
-
Learn more about using Hiera with
|
|
448
|
+
Learn more about using Hiera with OpenBolt at https://docs.openvoxproject.org/openbolt/latest/hiera.html.
|
|
449
449
|
|
|
450
450
|
#{colorize(:cyan, 'Examples')}
|
|
451
451
|
bolt lookup password --targets servers
|
|
@@ -460,16 +460,16 @@ module Bolt
|
|
|
460
460
|
bolt module <action> [options]
|
|
461
461
|
|
|
462
462
|
#{colorize(:cyan, 'Description')}
|
|
463
|
-
Manage
|
|
463
|
+
Manage OpenBolt project modules.
|
|
464
464
|
|
|
465
465
|
#{colorize(:cyan, 'Documentation')}
|
|
466
|
-
To learn more about
|
|
466
|
+
To learn more about modules, run 'bolt guide module'.
|
|
467
467
|
|
|
468
468
|
#{colorize(:cyan, 'Actions')}
|
|
469
469
|
add Add a module to the project
|
|
470
470
|
generate-types Generate type references to register in plans
|
|
471
471
|
install Install the project's modules
|
|
472
|
-
show List modules available to the
|
|
472
|
+
show List modules available to the OpenBolt project
|
|
473
473
|
HELP
|
|
474
474
|
|
|
475
475
|
MODULE_ADD_HELP = <<~HELP
|
|
@@ -483,11 +483,11 @@ module Bolt
|
|
|
483
483
|
Add a module to the project.
|
|
484
484
|
|
|
485
485
|
Module declarations are loaded from the project's configuration
|
|
486
|
-
file.
|
|
486
|
+
file. OpenBolt will automatically resolve all module dependencies,
|
|
487
487
|
generate a Puppetfile, and install the modules.
|
|
488
488
|
|
|
489
489
|
#{colorize(:cyan, 'Documentation')}
|
|
490
|
-
To learn more about
|
|
490
|
+
To learn more about modules, run 'bolt guide module'.
|
|
491
491
|
HELP
|
|
492
492
|
|
|
493
493
|
MODULE_GENERATETYPES_HELP = <<~HELP
|
|
@@ -499,10 +499,10 @@ module Bolt
|
|
|
499
499
|
|
|
500
500
|
#{colorize(:cyan, 'Description')}
|
|
501
501
|
Generate type references to register in plans. To learn more about
|
|
502
|
-
|
|
502
|
+
modules, run 'bolt guide module'.
|
|
503
503
|
|
|
504
504
|
#{colorize(:cyan, 'Documentation')}
|
|
505
|
-
To learn more about
|
|
505
|
+
To learn more about modules, run 'bolt guide module'.
|
|
506
506
|
HELP
|
|
507
507
|
|
|
508
508
|
MODULE_INSTALL_HELP = <<~HELP
|
|
@@ -516,11 +516,11 @@ module Bolt
|
|
|
516
516
|
Install the project's modules.
|
|
517
517
|
|
|
518
518
|
Module declarations are loaded from the project's configuration
|
|
519
|
-
file.
|
|
519
|
+
file. OpenBolt will automatically resolve all module dependencies,
|
|
520
520
|
generate a Puppetfile, and install the modules.
|
|
521
521
|
|
|
522
522
|
#{colorize(:cyan, 'Documentation')}
|
|
523
|
-
To learn more about
|
|
523
|
+
To learn more about modules, run 'bolt guide module'.
|
|
524
524
|
HELP
|
|
525
525
|
|
|
526
526
|
MODULE_SHOW_HELP = <<~HELP
|
|
@@ -531,13 +531,13 @@ module Bolt
|
|
|
531
531
|
bolt module show [module name] [options]
|
|
532
532
|
|
|
533
533
|
#{colorize(:cyan, 'Description')}
|
|
534
|
-
List modules available to the
|
|
534
|
+
List modules available to the OpenBolt project.
|
|
535
535
|
|
|
536
536
|
Providing the name of a module will display detailed documentation for
|
|
537
537
|
the module.
|
|
538
538
|
|
|
539
539
|
#{colorize(:cyan, 'Documentation')}
|
|
540
|
-
To learn more about
|
|
540
|
+
To learn more about modules, run 'bolt guide module'.
|
|
541
541
|
HELP
|
|
542
542
|
|
|
543
543
|
PLAN_HELP = <<~HELP
|
|
@@ -548,13 +548,13 @@ module Bolt
|
|
|
548
548
|
bolt plan <action> [options]
|
|
549
549
|
|
|
550
550
|
#{colorize(:cyan, 'Description')}
|
|
551
|
-
Convert, create, show, and run
|
|
551
|
+
Convert, create, show, and run plans.
|
|
552
552
|
|
|
553
553
|
#{colorize(:cyan, 'Documentation')}
|
|
554
|
-
Learn more about
|
|
554
|
+
Learn more about plans at https://docs.openvoxproject.org/openbolt/latest/plans.html.
|
|
555
555
|
|
|
556
556
|
#{colorize(:cyan, 'Actions')}
|
|
557
|
-
convert Convert a YAML plan to a
|
|
557
|
+
convert Convert a YAML plan to a Puppet language plan
|
|
558
558
|
new Create a new plan in the current project
|
|
559
559
|
run Run a plan on the specified targets
|
|
560
560
|
show Show available plans and plan documentation
|
|
@@ -576,7 +576,7 @@ module Bolt
|
|
|
576
576
|
functionality. Note that the converted plan is not written to a file.
|
|
577
577
|
|
|
578
578
|
#{colorize(:cyan, 'Documentation')}
|
|
579
|
-
Learn more about
|
|
579
|
+
Learn more about plans at https://docs.openvoxproject.org/openbolt/latest/plans.html.
|
|
580
580
|
|
|
581
581
|
#{colorize(:cyan, 'Examples')}
|
|
582
582
|
bolt plan convert myproject::myplan
|
|
@@ -594,7 +594,7 @@ module Bolt
|
|
|
594
594
|
Create a new plan in the current project.
|
|
595
595
|
|
|
596
596
|
#{colorize(:cyan, 'Documentation')}
|
|
597
|
-
Learn more about
|
|
597
|
+
Learn more about plans at https://docs.openvoxproject.org/openbolt/latest/plans.html.
|
|
598
598
|
|
|
599
599
|
#{colorize(:cyan, 'Examples')}
|
|
600
600
|
bolt plan new myproject::myplan
|
|
@@ -611,7 +611,7 @@ module Bolt
|
|
|
611
611
|
Run a plan on the specified targets.
|
|
612
612
|
|
|
613
613
|
#{colorize(:cyan, 'Documentation')}
|
|
614
|
-
Learn more about
|
|
614
|
+
Learn more about plans at https://docs.openvoxproject.org/openbolt/latest/plans.html.
|
|
615
615
|
|
|
616
616
|
#{colorize(:cyan, 'Examples')}
|
|
617
617
|
bolt plan run canary --targets target1,target2 command=hostname
|
|
@@ -628,13 +628,13 @@ module Bolt
|
|
|
628
628
|
Show available plans and plan documentation.
|
|
629
629
|
|
|
630
630
|
Omitting the name of a plan will display a list of plans available
|
|
631
|
-
in the
|
|
631
|
+
in the OpenBolt project.
|
|
632
632
|
|
|
633
633
|
Providing the name of a plan will display detailed documentation for
|
|
634
634
|
the plan, including a list of available parameters.
|
|
635
635
|
|
|
636
636
|
#{colorize(:cyan, 'Documentation')}
|
|
637
|
-
Learn more about
|
|
637
|
+
Learn more about plans at https://docs.openvoxproject.org/openbolt/latest/plans.html.
|
|
638
638
|
|
|
639
639
|
#{colorize(:cyan, 'Examples')}
|
|
640
640
|
Display a list of available plans
|
|
@@ -654,7 +654,7 @@ module Bolt
|
|
|
654
654
|
Show available plugins.
|
|
655
655
|
|
|
656
656
|
#{colorize(:cyan, 'Documentation')}
|
|
657
|
-
Learn more about
|
|
657
|
+
Learn more about plugins at https://docs.openvoxproject.org/openbolt/latest/using_plugins.html.
|
|
658
658
|
|
|
659
659
|
#{colorize(:cyan, 'Actions')}
|
|
660
660
|
show Show available plugins
|
|
@@ -671,7 +671,7 @@ module Bolt
|
|
|
671
671
|
Show available plugins.
|
|
672
672
|
|
|
673
673
|
#{colorize(:cyan, 'Documentation')}
|
|
674
|
-
Learn more about
|
|
674
|
+
Learn more about plugins at https://docs.openvoxproject.org/openbolt/latest/using_plugins.html.
|
|
675
675
|
HELP
|
|
676
676
|
|
|
677
677
|
POLICY_HELP = <<~HELP
|
|
@@ -731,14 +731,14 @@ module Bolt
|
|
|
731
731
|
bolt project <action> [options]
|
|
732
732
|
|
|
733
733
|
#{colorize(:cyan, 'Description')}
|
|
734
|
-
Create and migrate
|
|
734
|
+
Create and migrate OpenBolt projects
|
|
735
735
|
|
|
736
736
|
#{colorize(:cyan, 'Documentation')}
|
|
737
|
-
To learn more about
|
|
737
|
+
To learn more about OpenBolt projects, run 'bolt guide project'.
|
|
738
738
|
|
|
739
739
|
#{colorize(:cyan, 'Actions')}
|
|
740
|
-
init Create a new
|
|
741
|
-
migrate Migrate
|
|
740
|
+
init Create a new OpenBolt project
|
|
741
|
+
migrate Migrate an OpenBolt project to the latest version
|
|
742
742
|
HELP
|
|
743
743
|
|
|
744
744
|
PROJECT_INIT_HELP = <<~HELP
|
|
@@ -749,19 +749,19 @@ module Bolt
|
|
|
749
749
|
bolt project init [name] [options]
|
|
750
750
|
|
|
751
751
|
#{colorize(:cyan, 'Description')}
|
|
752
|
-
Create a new
|
|
752
|
+
Create a new OpenBolt project in the current working directory.
|
|
753
753
|
|
|
754
|
-
Specify a name for the
|
|
754
|
+
Specify a name for the OpenBolt project. Defaults to the basename of the current working directory.
|
|
755
755
|
|
|
756
756
|
#{colorize(:cyan, 'Documentation')}
|
|
757
|
-
To learn more about
|
|
757
|
+
To learn more about OpenBolt projects, run 'bolt guide project'.
|
|
758
758
|
|
|
759
759
|
#{colorize(:cyan, 'Examples')}
|
|
760
|
-
Create a new
|
|
760
|
+
Create a new OpenBolt project using the directory as the project name.
|
|
761
761
|
bolt project init
|
|
762
|
-
Create a new
|
|
762
|
+
Create a new OpenBolt project with a specified name.
|
|
763
763
|
bolt project init myproject
|
|
764
|
-
Create a new
|
|
764
|
+
Create a new OpenBolt project with existing modules.
|
|
765
765
|
bolt project init --modules puppetlabs-apt,puppetlabs-ntp
|
|
766
766
|
HELP
|
|
767
767
|
|
|
@@ -773,11 +773,11 @@ module Bolt
|
|
|
773
773
|
bolt project migrate [options]
|
|
774
774
|
|
|
775
775
|
#{colorize(:cyan, 'Description')}
|
|
776
|
-
Migrate
|
|
776
|
+
Migrate an OpenBolt project to use current best practices and the latest version of
|
|
777
777
|
configuration files.
|
|
778
778
|
|
|
779
779
|
#{colorize(:cyan, 'Documentation')}
|
|
780
|
-
To learn more about
|
|
780
|
+
To learn more about OpenBolt projects, run 'bolt guide project'.
|
|
781
781
|
HELP
|
|
782
782
|
|
|
783
783
|
SCRIPT_HELP = <<~HELP
|
|
@@ -791,7 +791,7 @@ module Bolt
|
|
|
791
791
|
Run a script on the specified targets.
|
|
792
792
|
|
|
793
793
|
#{colorize(:cyan, 'Documentation')}
|
|
794
|
-
Learn more about running scripts at https://
|
|
794
|
+
Learn more about running scripts at https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
795
795
|
|
|
796
796
|
#{colorize(:cyan, 'Actions')}
|
|
797
797
|
run Run a script on the specified targets.
|
|
@@ -813,7 +813,7 @@ module Bolt
|
|
|
813
813
|
be quoted.
|
|
814
814
|
|
|
815
815
|
#{colorize(:cyan, 'Documentation')}
|
|
816
|
-
Learn more about running scripts at https://
|
|
816
|
+
Learn more about running scripts at https://docs.openvoxproject.org/openbolt/latest/running_bolt_commands.html.
|
|
817
817
|
|
|
818
818
|
#{colorize(:cyan, 'Examples')}
|
|
819
819
|
bolt script run myscript.sh 'echo hello' --targets target1,target2
|
|
@@ -830,7 +830,7 @@ module Bolt
|
|
|
830
830
|
Create encryption keys and encrypt and decrypt values.
|
|
831
831
|
|
|
832
832
|
#{colorize(:cyan, 'Documentation')}
|
|
833
|
-
Learn more about secrets plugins at
|
|
833
|
+
Learn more about secrets plugins at https://docs.openvoxproject.org/openbolt/latest/using_plugins.html.
|
|
834
834
|
|
|
835
835
|
#{colorize(:cyan, 'Actions')}
|
|
836
836
|
createkeys Create new encryption keys
|
|
@@ -849,7 +849,7 @@ module Bolt
|
|
|
849
849
|
Create new encryption keys.
|
|
850
850
|
|
|
851
851
|
#{colorize(:cyan, 'Documentation')}
|
|
852
|
-
Learn more about secrets plugins at
|
|
852
|
+
Learn more about secrets plugins at https://docs.openvoxproject.org/openbolt/latest/using_plugins.html.
|
|
853
853
|
HELP
|
|
854
854
|
|
|
855
855
|
SECRET_DECRYPT_HELP = <<~HELP
|
|
@@ -863,7 +863,7 @@ module Bolt
|
|
|
863
863
|
Decrypt a value.
|
|
864
864
|
|
|
865
865
|
#{colorize(:cyan, 'Documentation')}
|
|
866
|
-
Learn more about secrets plugins at
|
|
866
|
+
Learn more about secrets plugins at https://docs.openvoxproject.org/openbolt/latest/using_plugins.html.
|
|
867
867
|
HELP
|
|
868
868
|
|
|
869
869
|
SECRET_ENCRYPT_HELP = <<~HELP
|
|
@@ -877,7 +877,7 @@ module Bolt
|
|
|
877
877
|
Encrypt a value.
|
|
878
878
|
|
|
879
879
|
#{colorize(:cyan, 'Documentation')}
|
|
880
|
-
Learn more about secrets plugins at
|
|
880
|
+
Learn more about secrets plugins at https://docs.openvoxproject.org/openbolt/latest/using_plugins.html.
|
|
881
881
|
HELP
|
|
882
882
|
|
|
883
883
|
TASK_HELP = <<~HELP
|
|
@@ -888,13 +888,13 @@ module Bolt
|
|
|
888
888
|
bolt task <action> [options]
|
|
889
889
|
|
|
890
890
|
#{colorize(:cyan, 'Description')}
|
|
891
|
-
Show and run
|
|
891
|
+
Show and run tasks.
|
|
892
892
|
|
|
893
893
|
#{colorize(:cyan, 'Documentation')}
|
|
894
|
-
Learn more about
|
|
894
|
+
Learn more about tasks at https://docs.openvoxproject.org/openbolt/latest/tasks.html.
|
|
895
895
|
|
|
896
896
|
#{colorize(:cyan, 'Actions')}
|
|
897
|
-
run Run a
|
|
897
|
+
run Run a task
|
|
898
898
|
show Show available tasks and task documentation
|
|
899
899
|
HELP
|
|
900
900
|
|
|
@@ -912,7 +912,7 @@ module Bolt
|
|
|
912
912
|
Parameters take the form parameter=value.
|
|
913
913
|
|
|
914
914
|
#{colorize(:cyan, 'Documentation')}
|
|
915
|
-
Learn more about
|
|
915
|
+
Learn more about tasks at https://docs.openvoxproject.org/openbolt/latest/tasks.html.
|
|
916
916
|
|
|
917
917
|
#{colorize(:cyan, 'Examples')}
|
|
918
918
|
bolt task run package --targets target1,target2 action=status name=bash
|
|
@@ -929,13 +929,13 @@ module Bolt
|
|
|
929
929
|
Show available tasks and task documentation.
|
|
930
930
|
|
|
931
931
|
Omitting the name of a task will display a list of tasks available
|
|
932
|
-
in the
|
|
932
|
+
in the OpenBolt project.
|
|
933
933
|
|
|
934
934
|
Providing the name of a task will display detailed documentation for
|
|
935
935
|
the task, including a list of available parameters.
|
|
936
936
|
|
|
937
937
|
#{colorize(:cyan, 'Documentation')}
|
|
938
|
-
Learn more about
|
|
938
|
+
Learn more about tasks at https://docs.openvoxproject.org/openbolt/latest/tasks.html.
|
|
939
939
|
|
|
940
940
|
#{colorize(:cyan, 'Examples')}
|
|
941
941
|
Display a list of available tasks
|
|
@@ -962,7 +962,7 @@ module Bolt
|
|
|
962
962
|
"Available filters are 'all', 'failure', and 'success'.") do |rerun|
|
|
963
963
|
@options[:rerun] = rerun
|
|
964
964
|
end
|
|
965
|
-
define('--noop', 'See what changes
|
|
965
|
+
define('--noop', 'See what changes OpenBolt will make without actually executing the changes.') do |_|
|
|
966
966
|
@options[:noop] = true
|
|
967
967
|
end
|
|
968
968
|
define('--params PARAMETERS',
|
|
@@ -1034,7 +1034,7 @@ module Bolt
|
|
|
1034
1034
|
@options[:cleanup] = cleanup
|
|
1035
1035
|
end
|
|
1036
1036
|
define('-m', '--modulepath MODULES',
|
|
1037
|
-
"List of directories containing modules, separated by '#{File::PATH_SEPARATOR}'",
|
|
1037
|
+
"List of directories containing modules, separated by '#{File::PATH_SEPARATOR}'.",
|
|
1038
1038
|
'Directories are case-sensitive.') do |modulepath|
|
|
1039
1039
|
# When specified from the CLI, modulepath entries are relative to pwd
|
|
1040
1040
|
@options[:modulepath] = modulepath.split(File::PATH_SEPARATOR).map do |moduledir|
|
|
@@ -1042,7 +1042,7 @@ module Bolt
|
|
|
1042
1042
|
end
|
|
1043
1043
|
end
|
|
1044
1044
|
define('--project PATH',
|
|
1045
|
-
'Path to load the
|
|
1045
|
+
'Path to load the OpenBolt project from (default: autodiscovered from current dir).') do |path|
|
|
1046
1046
|
@options[:project] = path
|
|
1047
1047
|
end
|
|
1048
1048
|
define('--hiera-config PATH',
|
|
@@ -1161,7 +1161,7 @@ module Bolt
|
|
|
1161
1161
|
separator "\n#{self.class.colorize(:cyan, 'Module options')}"
|
|
1162
1162
|
define('--[no-]resolve',
|
|
1163
1163
|
'Use --no-resolve to install modules listed in the Puppetfile without resolving modules configured',
|
|
1164
|
-
'in
|
|
1164
|
+
'in OpenBolt project configuration.') do |resolve|
|
|
1165
1165
|
@options[:resolve] = resolve
|
|
1166
1166
|
end
|
|
1167
1167
|
|
|
@@ -1183,7 +1183,7 @@ module Bolt
|
|
|
1183
1183
|
if File.exist?(path) || Pathname.new(path).absolute? ||
|
|
1184
1184
|
!%w[scripts files].include?(path.split(File::SEPARATOR)[1])
|
|
1185
1185
|
raise Bolt::CLIError, "The script must be a detailed Puppet file reference, " \
|
|
1186
|
-
"for example 'mymodule/scripts/myscript.sh'. See
|
|
1186
|
+
"for example 'mymodule/scripts/myscript.sh'. See https://docs.openvoxproject.org/openbolt/latest/bolt_running_scripts.html for " \
|
|
1187
1187
|
"more information on detailed Puppet file references."
|
|
1188
1188
|
end
|
|
1189
1189
|
|
|
@@ -1210,7 +1210,7 @@ module Bolt
|
|
|
1210
1210
|
end
|
|
1211
1211
|
define('--stream',
|
|
1212
1212
|
'Stream output from scripts and commands to the console.',
|
|
1213
|
-
'Run with --no-verbose to prevent
|
|
1213
|
+
'Run with --no-verbose to prevent OpenBolt from displaying output',
|
|
1214
1214
|
'a second time after the action is completed.') do |_|
|
|
1215
1215
|
@options[:stream] = true
|
|
1216
1216
|
end
|
data/lib/bolt/cli.rb
CHANGED
|
@@ -675,7 +675,8 @@ module Bolt
|
|
|
675
675
|
end
|
|
676
676
|
|
|
677
677
|
# Process the target list by turning a PuppetDB query or rerun mode into a
|
|
678
|
-
# list of target names.
|
|
678
|
+
# list of target names. Try to parse each options[:targets] entry as JSON
|
|
679
|
+
# Array/Hash, return the value as-is if failed.
|
|
679
680
|
#
|
|
680
681
|
# @param plugins [Bolt::Plugin] The Plugin instance.
|
|
681
682
|
# @param rerun [Bolt::Rerun] The Rerun instance.
|
|
@@ -688,7 +689,25 @@ module Bolt
|
|
|
688
689
|
elsif options[:rerun]
|
|
689
690
|
rerun.get_targets(options[:rerun])
|
|
690
691
|
elsif options[:targets]
|
|
691
|
-
options[:targets]
|
|
692
|
+
options[:targets].map do |target|
|
|
693
|
+
parsed = JSON.parse(target)
|
|
694
|
+
case parsed
|
|
695
|
+
when Array
|
|
696
|
+
parsed
|
|
697
|
+
when Hash
|
|
698
|
+
items = parsed['items']
|
|
699
|
+
if items.is_a?(Array)
|
|
700
|
+
items.map { |item| item['target'] }
|
|
701
|
+
else
|
|
702
|
+
raise Bolt::Error.new("Expected a JSON array or an object with an 'items' array, got #{parsed.class}",
|
|
703
|
+
'bolt/invalid-targets')
|
|
704
|
+
end
|
|
705
|
+
else
|
|
706
|
+
target
|
|
707
|
+
end
|
|
708
|
+
rescue JSON::ParserError
|
|
709
|
+
target
|
|
710
|
+
end
|
|
692
711
|
end
|
|
693
712
|
end
|
|
694
713
|
|
data/lib/bolt/config/options.rb
CHANGED
|
@@ -185,7 +185,7 @@ module Bolt
|
|
|
185
185
|
},
|
|
186
186
|
"disable-warnings" => {
|
|
187
187
|
description: "An array of IDs of warnings to suppress. Warnings with a matching ID will not be logged " \
|
|
188
|
-
"by
|
|
188
|
+
"by OpenBolt. If you are upgrading OpenBolt to a new major version, you should re-enable all warnings " \
|
|
189
189
|
"until you have finished upgrading.",
|
|
190
190
|
type: Array,
|
|
191
191
|
items: {
|
|
@@ -203,7 +203,7 @@ module Bolt
|
|
|
203
203
|
_default: "human"
|
|
204
204
|
},
|
|
205
205
|
"future" => {
|
|
206
|
-
description: "Enable new
|
|
206
|
+
description: "Enable new OpenBolt features that may include breaking changes.",
|
|
207
207
|
type: Hash,
|
|
208
208
|
properties: {
|
|
209
209
|
"file_paths" => {
|
|
@@ -211,7 +211,7 @@ module Bolt
|
|
|
211
211
|
type: [TrueClass, FalseClass],
|
|
212
212
|
_example: true,
|
|
213
213
|
_default: false,
|
|
214
|
-
_deprecation: "
|
|
214
|
+
_deprecation: "OpenBolt no longer honors this option and enables loading scripts from the scripts " \
|
|
215
215
|
"directory by default."
|
|
216
216
|
},
|
|
217
217
|
"script_interpreter" => {
|
|
@@ -258,9 +258,9 @@ module Bolt
|
|
|
258
258
|
description: "A map of configuration for the logfile output. Under `log`, you can configure log options " \
|
|
259
259
|
"for `console` and add configuration for individual log files, such as " \
|
|
260
260
|
"`~/.puppetlabs/bolt/debug.log`. Individual log files must be valid filepaths. If the log " \
|
|
261
|
-
"file does not exist, then
|
|
261
|
+
"file does not exist, then OpenBolt will create it before logging information. Set the value to " \
|
|
262
262
|
"`disable` to remove a log file defined at an earlier level of the config hierarchy. By " \
|
|
263
|
-
"default,
|
|
263
|
+
"default, OpenBolt logs to a bolt-debug.log file in the OpenBolt project directory.",
|
|
264
264
|
type: Hash,
|
|
265
265
|
properties: {
|
|
266
266
|
"console" => {
|
|
@@ -300,7 +300,7 @@ module Bolt
|
|
|
300
300
|
"~/logs/debug.log" => { "append" => false, "level" => "debug" } }
|
|
301
301
|
},
|
|
302
302
|
"modulepath" => {
|
|
303
|
-
description: "An array of directories that
|
|
303
|
+
description: "An array of directories that OpenBolt loads content such as plans and tasks from. Read more " \
|
|
304
304
|
"about modules in [Module structure](module_structure.md).",
|
|
305
305
|
type: [Array, String],
|
|
306
306
|
items: {
|
|
@@ -311,7 +311,7 @@ module Bolt
|
|
|
311
311
|
_default: ["project/modules"]
|
|
312
312
|
},
|
|
313
313
|
"module-install" => {
|
|
314
|
-
description: "Options that configure where
|
|
314
|
+
description: "Options that configure where OpenBolt downloads modules from. This option is only used when " \
|
|
315
315
|
"installing modules using the `bolt module add|install` commands and " \
|
|
316
316
|
"`Add|Install-BoltModule` cmdlets.",
|
|
317
317
|
type: Hash,
|
|
@@ -359,7 +359,7 @@ module Bolt
|
|
|
359
359
|
description: "A list of module dependencies for the project. Each dependency is a map of data specifying " \
|
|
360
360
|
"the module to install. To install the project's module dependencies, run the `bolt module " \
|
|
361
361
|
"install` command. For more information about specifying modules, see [the " \
|
|
362
|
-
"documentation](
|
|
362
|
+
"documentation](bolt_installing_modules.md#manually-specify-modules-in-a-bolt-project).",
|
|
363
363
|
type: Array,
|
|
364
364
|
items: {
|
|
365
365
|
type: [Hash, String],
|
|
@@ -417,8 +417,8 @@ module Bolt
|
|
|
417
417
|
]
|
|
418
418
|
},
|
|
419
419
|
"name" => {
|
|
420
|
-
description: "The name of the
|
|
421
|
-
"[
|
|
420
|
+
description: "The name of the OpenBolt project. When this option is configured, the project is considered an " \
|
|
421
|
+
"[OpenBolt project](projects.md), allowing OpenBolt to load content from the project directory " \
|
|
422
422
|
"as though it were a module.",
|
|
423
423
|
type: String,
|
|
424
424
|
_plugin: false,
|
|
@@ -427,7 +427,7 @@ module Bolt
|
|
|
427
427
|
"plans" => {
|
|
428
428
|
description: "A list of plan names and glob patterns to filter the project's plans by. This option is used " \
|
|
429
429
|
"to limit the visibility of plans for users of the project. For example, project authors " \
|
|
430
|
-
"might want to limit the visibility of plans that are bundled with
|
|
430
|
+
"might want to limit the visibility of plans that are bundled with OpenBolt or plans that should " \
|
|
431
431
|
"only be run as part of another plan. When this option is not configured, all plans are " \
|
|
432
432
|
"visible. This option does not prevent users from running plans that are not part of this " \
|
|
433
433
|
"list.",
|
|
@@ -467,7 +467,7 @@ module Bolt
|
|
|
467
467
|
_example: ["myproject::apache", "myproject::postgres"]
|
|
468
468
|
},
|
|
469
469
|
"puppetdb" => {
|
|
470
|
-
description: "A map containing options for [configuring the
|
|
470
|
+
description: "A map containing options for [configuring the OpenBolt PuppetDB " \
|
|
471
471
|
"client](bolt_connect_puppetdb.md).",
|
|
472
472
|
type: Hash,
|
|
473
473
|
properties: PUPPETDB_OPTIONS,
|
|
@@ -476,7 +476,7 @@ module Bolt
|
|
|
476
476
|
"puppetdb-instances" => {
|
|
477
477
|
description: "A map of named PuppetDB instances and their configuration, where keys are the name " \
|
|
478
478
|
"of a PuppetDB instance and values are maps of configuration options. For more " \
|
|
479
|
-
"information, see [Connecting
|
|
479
|
+
"information, see [Connecting OpenBolt to OpenVoxDB](bolt_connect_puppetdb.md).",
|
|
480
480
|
type: Hash,
|
|
481
481
|
additionalProperties: {
|
|
482
482
|
type: Hash,
|
|
@@ -492,7 +492,7 @@ module Bolt
|
|
|
492
492
|
_plugin: true
|
|
493
493
|
},
|
|
494
494
|
"save-rerun" => {
|
|
495
|
-
description: "Whether to update `.rerun.json` in the
|
|
495
|
+
description: "Whether to update `.rerun.json` in the OpenBolt project directory. If " \
|
|
496
496
|
"your target names include passwords, set this value to `false` to avoid " \
|
|
497
497
|
"writing passwords to disk.",
|
|
498
498
|
type: [TrueClass, FalseClass],
|
|
@@ -501,7 +501,7 @@ module Bolt
|
|
|
501
501
|
_default: true
|
|
502
502
|
},
|
|
503
503
|
"spinner" => {
|
|
504
|
-
description: "Whether to print a spinner to the console for long-running
|
|
504
|
+
description: "Whether to print a spinner to the console for long-running OpenBolt operations.",
|
|
505
505
|
type: [TrueClass, FalseClass],
|
|
506
506
|
_plugin: false,
|
|
507
507
|
_example: false,
|
|
@@ -518,7 +518,7 @@ module Bolt
|
|
|
518
518
|
"tasks" => {
|
|
519
519
|
description: "A list of task names and glob patterns to filter the project's tasks by. This option is used " \
|
|
520
520
|
"to limit the visibility of tasks for users of the project. For example, project authors " \
|
|
521
|
-
"might want to limit the visibility of tasks that are bundled with
|
|
521
|
+
"might want to limit the visibility of tasks that are bundled with OpenBolt or plans that should " \
|
|
522
522
|
"only be run as part of a larger workflow. When this option is not configured, all tasks " \
|
|
523
523
|
"are visible. This option does not prevent users from running tasks that are not part of " \
|
|
524
524
|
"this list.",
|
|
@@ -530,8 +530,8 @@ module Bolt
|
|
|
530
530
|
_example: ["myproject", "myproject::foo", "myproject::bar", "myproject::deploy_*"]
|
|
531
531
|
},
|
|
532
532
|
"trusted-external-command" => {
|
|
533
|
-
description: "The path to an executable on the
|
|
534
|
-
"**External trusted facts are experimental in both Puppet and
|
|
533
|
+
description: "The path to an executable on the OpenBolt controller that can produce external trusted facts. " \
|
|
534
|
+
"**External trusted facts are experimental in both Puppet and OpenBolt and this API might " \
|
|
535
535
|
"change or be removed.**",
|
|
536
536
|
type: String,
|
|
537
537
|
_plugin: false,
|