bolt 2.34.0 → 2.40.1

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/Puppetfile +1 -1
  3. data/bolt-modules/boltlib/lib/puppet/datatypes/applyresult.rb +1 -0
  4. data/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +1 -3
  5. data/bolt-modules/boltlib/lib/puppet/functions/download_file.rb +17 -6
  6. data/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb +56 -0
  7. data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +24 -6
  8. data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +27 -8
  9. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +21 -1
  10. data/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +18 -1
  11. data/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +24 -6
  12. data/lib/bolt/analytics.rb +27 -8
  13. data/lib/bolt/apply_result.rb +3 -3
  14. data/lib/bolt/bolt_option_parser.rb +45 -18
  15. data/lib/bolt/cli.rb +98 -116
  16. data/lib/bolt/config.rb +184 -80
  17. data/lib/bolt/config/options.rb +148 -87
  18. data/lib/bolt/config/transport/base.rb +10 -19
  19. data/lib/bolt/config/transport/local.rb +1 -7
  20. data/lib/bolt/config/transport/options.rb +12 -69
  21. data/lib/bolt/config/transport/ssh.rb +8 -19
  22. data/lib/bolt/error.rb +24 -0
  23. data/lib/bolt/executor.rb +92 -18
  24. data/lib/bolt/inventory.rb +25 -0
  25. data/lib/bolt/inventory/group.rb +0 -8
  26. data/lib/bolt/inventory/options.rb +130 -0
  27. data/lib/bolt/inventory/target.rb +10 -11
  28. data/lib/bolt/module_installer.rb +21 -13
  29. data/lib/bolt/module_installer/resolver.rb +1 -1
  30. data/lib/bolt/outputter.rb +19 -5
  31. data/lib/bolt/outputter/human.rb +22 -3
  32. data/lib/bolt/outputter/json.rb +1 -1
  33. data/lib/bolt/outputter/logger.rb +1 -1
  34. data/lib/bolt/outputter/rainbow.rb +13 -2
  35. data/lib/bolt/pal.rb +18 -6
  36. data/lib/bolt/pal/yaml_plan.rb +7 -0
  37. data/lib/bolt/plugin.rb +41 -12
  38. data/lib/bolt/plugin/cache.rb +76 -0
  39. data/lib/bolt/plugin/module.rb +4 -4
  40. data/lib/bolt/plugin/puppetdb.rb +1 -1
  41. data/lib/bolt/project.rb +59 -40
  42. data/lib/bolt/project_manager.rb +201 -0
  43. data/lib/bolt/{project_migrator/config.rb → project_manager/config_migrator.rb} +49 -4
  44. data/lib/bolt/{project_migrator/inventory.rb → project_manager/inventory_migrator.rb} +3 -3
  45. data/lib/bolt/{project_migrator/base.rb → project_manager/migrator.rb} +2 -2
  46. data/lib/bolt/{project_migrator/modules.rb → project_manager/module_migrator.rb} +5 -3
  47. data/lib/bolt/puppetdb/client.rb +11 -2
  48. data/lib/bolt/puppetdb/config.rb +4 -3
  49. data/lib/bolt/rerun.rb +1 -5
  50. data/lib/bolt/shell/bash.rb +8 -2
  51. data/lib/bolt/shell/powershell.rb +21 -3
  52. data/lib/bolt/target.rb +4 -0
  53. data/lib/bolt/task/run.rb +1 -1
  54. data/lib/bolt/transport/local.rb +13 -0
  55. data/lib/bolt/transport/orch.rb +0 -5
  56. data/lib/bolt/transport/orch/connection.rb +10 -3
  57. data/lib/bolt/transport/ssh/exec_connection.rb +6 -2
  58. data/lib/bolt/util.rb +36 -7
  59. data/lib/bolt/validator.rb +227 -0
  60. data/lib/bolt/version.rb +1 -1
  61. data/lib/bolt/yarn.rb +23 -0
  62. data/lib/bolt_server/base_config.rb +3 -1
  63. data/lib/bolt_server/config.rb +3 -1
  64. data/lib/bolt_server/plugin.rb +13 -0
  65. data/lib/bolt_server/plugin/puppet_connect_data.rb +37 -0
  66. data/lib/bolt_server/schemas/connect-data.json +22 -0
  67. data/lib/bolt_server/schemas/partials/task.json +2 -2
  68. data/lib/bolt_server/transport_app.rb +82 -23
  69. data/lib/bolt_spec/plans/mock_executor.rb +4 -1
  70. data/libexec/apply_catalog.rb +1 -1
  71. data/libexec/custom_facts.rb +1 -1
  72. data/libexec/query_resources.rb +1 -1
  73. metadata +22 -14
  74. data/lib/bolt/project_migrator.rb +0 -80
@@ -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