bolt 3.3.0 → 3.7.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.

Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/Puppetfile +5 -5
  3. data/bolt-modules/boltlib/lib/puppet/datatypes/containerresult.rb +24 -0
  4. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb +66 -0
  5. data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +20 -2
  6. data/bolt-modules/boltlib/lib/puppet/functions/run_container.rb +162 -0
  7. data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +19 -2
  8. data/bolt-modules/boltlib/types/planresult.pp +1 -0
  9. data/bolt-modules/prompt/lib/puppet/functions/prompt.rb +20 -2
  10. data/bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb +103 -0
  11. data/guides/targets.txt +31 -0
  12. data/lib/bolt/analytics.rb +4 -8
  13. data/lib/bolt/bolt_option_parser.rb +35 -17
  14. data/lib/bolt/cli.rb +109 -28
  15. data/lib/bolt/config.rb +11 -7
  16. data/lib/bolt/config/options.rb +41 -9
  17. data/lib/bolt/config/transport/lxd.rb +3 -1
  18. data/lib/bolt/config/transport/options.rb +7 -0
  19. data/lib/bolt/config/transport/podman.rb +33 -0
  20. data/lib/bolt/container_result.rb +105 -0
  21. data/lib/bolt/error.rb +15 -0
  22. data/lib/bolt/executor.rb +27 -15
  23. data/lib/bolt/inventory.rb +5 -4
  24. data/lib/bolt/inventory/inventory.rb +3 -2
  25. data/lib/bolt/inventory/options.rb +9 -0
  26. data/lib/bolt/inventory/target.rb +16 -0
  27. data/lib/bolt/node/output.rb +14 -4
  28. data/lib/bolt/outputter/human.rb +243 -84
  29. data/lib/bolt/outputter/json.rb +6 -4
  30. data/lib/bolt/outputter/logger.rb +17 -0
  31. data/lib/bolt/pal.rb +22 -2
  32. data/lib/bolt/pal/yaml_plan/step.rb +4 -2
  33. data/lib/bolt/pal/yaml_plan/step/command.rb +8 -0
  34. data/lib/bolt/pal/yaml_plan/step/script.rb +4 -0
  35. data/lib/bolt/pal/yaml_plan/transpiler.rb +2 -2
  36. data/lib/bolt/plan_creator.rb +2 -2
  37. data/lib/bolt/plugin.rb +13 -11
  38. data/lib/bolt/puppetdb/client.rb +54 -0
  39. data/lib/bolt/result.rb +5 -14
  40. data/lib/bolt/shell/bash.rb +33 -22
  41. data/lib/bolt/shell/powershell.rb +6 -8
  42. data/lib/bolt/transport/docker.rb +1 -1
  43. data/lib/bolt/transport/docker/connection.rb +21 -32
  44. data/lib/bolt/transport/lxd/connection.rb +5 -5
  45. data/lib/bolt/transport/orch.rb +13 -5
  46. data/lib/bolt/transport/podman.rb +19 -0
  47. data/lib/bolt/transport/podman/connection.rb +98 -0
  48. data/lib/bolt/util.rb +42 -0
  49. data/lib/bolt/version.rb +1 -1
  50. data/lib/bolt_server/transport_app.rb +3 -0
  51. data/lib/bolt_spec/plans/action_stubs/command_stub.rb +8 -1
  52. data/lib/bolt_spec/plans/action_stubs/script_stub.rb +8 -1
  53. data/lib/bolt_spec/plans/mock_executor.rb +91 -11
  54. data/modules/puppet_connect/plans/test_input_data.pp +22 -0
  55. metadata +11 -2
@@ -13,6 +13,19 @@
13
13
  #
14
14
  plan puppet_connect::test_input_data(TargetSpec $targets = 'all') {
15
15
  $targs = get_targets($targets)
16
+ $unique_plugins = $targs.group_by |$t| {$t.plugin_hooks['puppet_library']}
17
+ if ($unique_plugins.keys.length > 1) {
18
+ out::message('Multiple puppet_library plugin hooks detected')
19
+ $unique_plugins.each |$plug, $target_list| {
20
+ $target_message = if ($target_list.length > 10) {
21
+ "${target_list.length} targets"
22
+ } else {
23
+ $target_list.join(', ')
24
+ }
25
+ out::message("Plugin hook ${plug} configured for ${target_message}")
26
+ }
27
+ fail_plan("The puppet_library plugin config must be the same across all targets")
28
+ }
16
29
  $targs.each |$target| {
17
30
  case $target.transport {
18
31
  'ssh': {
@@ -59,6 +72,15 @@ plan puppet_connect::test_input_data(TargetSpec $targets = 'all') {
59
72
  fail_plan("Inventory contains target ${target} with unsupported transport, must be ssh or winrm")
60
73
  }
61
74
  }
75
+
76
+ # Bolt defaults to using the "module" based form of the puppet_agent plugin. Connect defaults
77
+ # to using the "task" based form as *only* the task based form in supported in Connect. This check
78
+ # ensures that if the default is not being used, only task based plugins are allowed.
79
+ $plugin = $target.plugin_hooks["puppet_library"]
80
+ $user_configured_plugin = $plugin != { "plugin"=> "puppet_agent", "stop_service"=> true }
81
+ if ($user_configured_plugin and $plugin["plugin"] != "task"){
82
+ fail_plan("Only task plugins are acceptable for puppet_library hook")
83
+ }
62
84
  }
63
85
  # The SSH/WinRM transports will report an 'unknown host' error for targets where
64
86
  # 'host' is unknown so run_command's implementation will take care of raising that
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.3.0
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -398,6 +398,7 @@ extra_rdoc_files: []
398
398
  files:
399
399
  - Puppetfile
400
400
  - bolt-modules/boltlib/lib/puppet/datatypes/applyresult.rb
401
+ - bolt-modules/boltlib/lib/puppet/datatypes/containerresult.rb
401
402
  - bolt-modules/boltlib/lib/puppet/datatypes/resourceinstance.rb
402
403
  - bolt-modules/boltlib/lib/puppet/datatypes/result.rb
403
404
  - bolt-modules/boltlib/lib/puppet/datatypes/resultset.rb
@@ -413,12 +414,14 @@ files:
413
414
  - bolt-modules/boltlib/lib/puppet/functions/get_target.rb
414
415
  - bolt-modules/boltlib/lib/puppet/functions/get_targets.rb
415
416
  - bolt-modules/boltlib/lib/puppet/functions/parallelize.rb
417
+ - bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb
416
418
  - bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb
417
419
  - bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb
418
420
  - bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb
419
421
  - bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb
420
422
  - bolt-modules/boltlib/lib/puppet/functions/resource.rb
421
423
  - bolt-modules/boltlib/lib/puppet/functions/run_command.rb
424
+ - bolt-modules/boltlib/lib/puppet/functions/run_container.rb
422
425
  - bolt-modules/boltlib/lib/puppet/functions/run_plan.rb
423
426
  - bolt-modules/boltlib/lib/puppet/functions/run_script.rb
424
427
  - bolt-modules/boltlib/lib/puppet/functions/run_task.rb
@@ -444,6 +447,7 @@ files:
444
447
  - bolt-modules/file/lib/puppet/functions/file/write.rb
445
448
  - bolt-modules/out/lib/puppet/functions/out/message.rb
446
449
  - bolt-modules/prompt/lib/puppet/functions/prompt.rb
450
+ - bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb
447
451
  - bolt-modules/system/lib/puppet/functions/system/env.rb
448
452
  - exe/bolt
449
453
  - guides/inventory.txt
@@ -451,6 +455,7 @@ files:
451
455
  - guides/module.txt
452
456
  - guides/modulepath.txt
453
457
  - guides/project.txt
458
+ - guides/targets.txt
454
459
  - lib/bolt.rb
455
460
  - lib/bolt/analytics.rb
456
461
  - lib/bolt/applicator.rb
@@ -470,9 +475,11 @@ files:
470
475
  - lib/bolt/config/transport/lxd.rb
471
476
  - lib/bolt/config/transport/options.rb
472
477
  - lib/bolt/config/transport/orch.rb
478
+ - lib/bolt/config/transport/podman.rb
473
479
  - lib/bolt/config/transport/remote.rb
474
480
  - lib/bolt/config/transport/ssh.rb
475
481
  - lib/bolt/config/transport/winrm.rb
482
+ - lib/bolt/container_result.rb
476
483
  - lib/bolt/error.rb
477
484
  - lib/bolt/executor.rb
478
485
  - lib/bolt/inventory.rb
@@ -560,6 +567,8 @@ files:
560
567
  - lib/bolt/transport/lxd/connection.rb
561
568
  - lib/bolt/transport/orch.rb
562
569
  - lib/bolt/transport/orch/connection.rb
570
+ - lib/bolt/transport/podman.rb
571
+ - lib/bolt/transport/podman/connection.rb
563
572
  - lib/bolt/transport/remote.rb
564
573
  - lib/bolt/transport/simple.rb
565
574
  - lib/bolt/transport/ssh.rb