openbolt 5.0.0.rc1

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.
Files changed (258) hide show
  1. checksums.yaml +7 -0
  2. data/Puppetfile +52 -0
  3. data/bolt-modules/boltlib/lib/puppet/datatypes/applyresult.rb +60 -0
  4. data/bolt-modules/boltlib/lib/puppet/datatypes/containerresult.rb +51 -0
  5. data/bolt-modules/boltlib/lib/puppet/datatypes/future.rb +25 -0
  6. data/bolt-modules/boltlib/lib/puppet/datatypes/resourceinstance.rb +71 -0
  7. data/bolt-modules/boltlib/lib/puppet/datatypes/result.rb +55 -0
  8. data/bolt-modules/boltlib/lib/puppet/datatypes/resultset.rb +65 -0
  9. data/bolt-modules/boltlib/lib/puppet/datatypes/target.rb +93 -0
  10. data/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb +33 -0
  11. data/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb +38 -0
  12. data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +208 -0
  13. data/bolt-modules/boltlib/lib/puppet/functions/background.rb +62 -0
  14. data/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +57 -0
  15. data/bolt-modules/boltlib/lib/puppet/functions/download_file.rb +130 -0
  16. data/bolt-modules/boltlib/lib/puppet/functions/facts.rb +31 -0
  17. data/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb +52 -0
  18. data/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb +87 -0
  19. data/bolt-modules/boltlib/lib/puppet/functions/get_target.rb +34 -0
  20. data/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb +35 -0
  21. data/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb +74 -0
  22. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_command.rb +97 -0
  23. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb +47 -0
  24. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +52 -0
  25. data/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb +40 -0
  26. data/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb +42 -0
  27. data/bolt-modules/boltlib/lib/puppet/functions/resource.rb +53 -0
  28. data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +106 -0
  29. data/bolt-modules/boltlib/lib/puppet/functions/run_container.rb +162 -0
  30. data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +291 -0
  31. data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +145 -0
  32. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +164 -0
  33. data/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +211 -0
  34. data/bolt-modules/boltlib/lib/puppet/functions/set_config.rb +48 -0
  35. data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +43 -0
  36. data/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb +145 -0
  37. data/bolt-modules/boltlib/lib/puppet/functions/set_var.rb +38 -0
  38. data/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +101 -0
  39. data/bolt-modules/boltlib/lib/puppet/functions/vars.rb +29 -0
  40. data/bolt-modules/boltlib/lib/puppet/functions/wait.rb +131 -0
  41. data/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb +59 -0
  42. data/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb +39 -0
  43. data/bolt-modules/boltlib/lib/puppet/functions/write_file.rb +50 -0
  44. data/bolt-modules/boltlib/types/planresult.pp +18 -0
  45. data/bolt-modules/boltlib/types/targetspec.pp +7 -0
  46. data/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb +42 -0
  47. data/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb +20 -0
  48. data/bolt-modules/dir/lib/puppet/functions/dir/children.rb +35 -0
  49. data/bolt-modules/file/lib/puppet/functions/file/delete.rb +21 -0
  50. data/bolt-modules/file/lib/puppet/functions/file/exists.rb +28 -0
  51. data/bolt-modules/file/lib/puppet/functions/file/join.rb +20 -0
  52. data/bolt-modules/file/lib/puppet/functions/file/read.rb +33 -0
  53. data/bolt-modules/file/lib/puppet/functions/file/readable.rb +28 -0
  54. data/bolt-modules/file/lib/puppet/functions/file/write.rb +24 -0
  55. data/bolt-modules/log/lib/puppet/functions/log/debug.rb +39 -0
  56. data/bolt-modules/log/lib/puppet/functions/log/error.rb +40 -0
  57. data/bolt-modules/log/lib/puppet/functions/log/fatal.rb +40 -0
  58. data/bolt-modules/log/lib/puppet/functions/log/info.rb +39 -0
  59. data/bolt-modules/log/lib/puppet/functions/log/trace.rb +39 -0
  60. data/bolt-modules/log/lib/puppet/functions/log/warn.rb +41 -0
  61. data/bolt-modules/out/lib/puppet/functions/out/message.rb +36 -0
  62. data/bolt-modules/out/lib/puppet/functions/out/verbose.rb +35 -0
  63. data/bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb +103 -0
  64. data/bolt-modules/prompt/lib/puppet/functions/prompt.rb +65 -0
  65. data/bolt-modules/system/lib/puppet/functions/system/env.rb +20 -0
  66. data/exe/bolt +17 -0
  67. data/guides/debugging.yaml +27 -0
  68. data/guides/inventory.yaml +23 -0
  69. data/guides/links.yaml +12 -0
  70. data/guides/logging.yaml +17 -0
  71. data/guides/module.yaml +18 -0
  72. data/guides/modulepath.yaml +24 -0
  73. data/guides/project.yaml +21 -0
  74. data/guides/targets.yaml +28 -0
  75. data/guides/transports.yaml +22 -0
  76. data/lib/bolt/analytics.rb +233 -0
  77. data/lib/bolt/application.rb +806 -0
  78. data/lib/bolt/applicator.rb +368 -0
  79. data/lib/bolt/apply_inventory.rb +93 -0
  80. data/lib/bolt/apply_result.rb +154 -0
  81. data/lib/bolt/apply_target.rb +90 -0
  82. data/lib/bolt/bolt_option_parser.rb +1226 -0
  83. data/lib/bolt/catalog/logging.rb +15 -0
  84. data/lib/bolt/catalog.rb +144 -0
  85. data/lib/bolt/cli.rb +949 -0
  86. data/lib/bolt/config/modulepath.rb +30 -0
  87. data/lib/bolt/config/options.rb +673 -0
  88. data/lib/bolt/config/transport/base.rb +133 -0
  89. data/lib/bolt/config/transport/docker.rb +34 -0
  90. data/lib/bolt/config/transport/jail.rb +33 -0
  91. data/lib/bolt/config/transport/local.rb +39 -0
  92. data/lib/bolt/config/transport/lxd.rb +34 -0
  93. data/lib/bolt/config/transport/options.rb +431 -0
  94. data/lib/bolt/config/transport/orch.rb +41 -0
  95. data/lib/bolt/config/transport/podman.rb +33 -0
  96. data/lib/bolt/config/transport/remote.rb +24 -0
  97. data/lib/bolt/config/transport/ssh.rb +138 -0
  98. data/lib/bolt/config/transport/winrm.rb +63 -0
  99. data/lib/bolt/config.rb +515 -0
  100. data/lib/bolt/container_result.rb +105 -0
  101. data/lib/bolt/error.rb +194 -0
  102. data/lib/bolt/executor.rb +539 -0
  103. data/lib/bolt/fiber_executor.rb +190 -0
  104. data/lib/bolt/inventory/group.rb +446 -0
  105. data/lib/bolt/inventory/inventory.rb +391 -0
  106. data/lib/bolt/inventory/options.rb +139 -0
  107. data/lib/bolt/inventory/target.rb +293 -0
  108. data/lib/bolt/inventory.rb +120 -0
  109. data/lib/bolt/logger.rb +252 -0
  110. data/lib/bolt/module.rb +54 -0
  111. data/lib/bolt/module_installer/installer.rb +44 -0
  112. data/lib/bolt/module_installer/puppetfile/forge_module.rb +54 -0
  113. data/lib/bolt/module_installer/puppetfile/git_module.rb +37 -0
  114. data/lib/bolt/module_installer/puppetfile/module.rb +26 -0
  115. data/lib/bolt/module_installer/puppetfile.rb +131 -0
  116. data/lib/bolt/module_installer/resolver.rb +129 -0
  117. data/lib/bolt/module_installer/specs/forge_spec.rb +91 -0
  118. data/lib/bolt/module_installer/specs/git_spec.rb +150 -0
  119. data/lib/bolt/module_installer/specs/id/base.rb +116 -0
  120. data/lib/bolt/module_installer/specs/id/gitclone.rb +120 -0
  121. data/lib/bolt/module_installer/specs/id/github.rb +90 -0
  122. data/lib/bolt/module_installer/specs/id/gitlab.rb +92 -0
  123. data/lib/bolt/module_installer/specs.rb +95 -0
  124. data/lib/bolt/module_installer.rb +208 -0
  125. data/lib/bolt/node/errors.rb +55 -0
  126. data/lib/bolt/node/output.rb +29 -0
  127. data/lib/bolt/outputter/human.rb +958 -0
  128. data/lib/bolt/outputter/json.rb +205 -0
  129. data/lib/bolt/outputter/logger.rb +76 -0
  130. data/lib/bolt/outputter/rainbow.rb +118 -0
  131. data/lib/bolt/outputter.rb +57 -0
  132. data/lib/bolt/pal/issues.rb +19 -0
  133. data/lib/bolt/pal/logging.rb +17 -0
  134. data/lib/bolt/pal/yaml_plan/evaluator.rb +83 -0
  135. data/lib/bolt/pal/yaml_plan/loader.rb +94 -0
  136. data/lib/bolt/pal/yaml_plan/parameter.rb +63 -0
  137. data/lib/bolt/pal/yaml_plan/step/command.rb +45 -0
  138. data/lib/bolt/pal/yaml_plan/step/download.rb +37 -0
  139. data/lib/bolt/pal/yaml_plan/step/eval.rb +42 -0
  140. data/lib/bolt/pal/yaml_plan/step/message.rb +31 -0
  141. data/lib/bolt/pal/yaml_plan/step/plan.rb +42 -0
  142. data/lib/bolt/pal/yaml_plan/step/resources.rb +170 -0
  143. data/lib/bolt/pal/yaml_plan/step/script.rb +62 -0
  144. data/lib/bolt/pal/yaml_plan/step/task.rb +42 -0
  145. data/lib/bolt/pal/yaml_plan/step/upload.rb +37 -0
  146. data/lib/bolt/pal/yaml_plan/step/verbose.rb +31 -0
  147. data/lib/bolt/pal/yaml_plan/step.rb +223 -0
  148. data/lib/bolt/pal/yaml_plan/transpiler.rb +90 -0
  149. data/lib/bolt/pal/yaml_plan.rb +172 -0
  150. data/lib/bolt/pal.rb +847 -0
  151. data/lib/bolt/plan_creator.rb +219 -0
  152. data/lib/bolt/plan_future.rb +86 -0
  153. data/lib/bolt/plan_result.rb +44 -0
  154. data/lib/bolt/plugin/cache.rb +76 -0
  155. data/lib/bolt/plugin/env_var.rb +54 -0
  156. data/lib/bolt/plugin/module.rb +276 -0
  157. data/lib/bolt/plugin/prompt.rb +36 -0
  158. data/lib/bolt/plugin/puppet_connect_data.rb +84 -0
  159. data/lib/bolt/plugin/puppetdb.rb +124 -0
  160. data/lib/bolt/plugin/task.rb +72 -0
  161. data/lib/bolt/plugin.rb +380 -0
  162. data/lib/bolt/project.rb +219 -0
  163. data/lib/bolt/project_manager/config_migrator.rb +113 -0
  164. data/lib/bolt/project_manager/inventory_migrator.rb +67 -0
  165. data/lib/bolt/project_manager/migrator.rb +39 -0
  166. data/lib/bolt/project_manager/module_migrator.rb +203 -0
  167. data/lib/bolt/project_manager.rb +221 -0
  168. data/lib/bolt/puppetdb/client.rb +153 -0
  169. data/lib/bolt/puppetdb/config.rb +176 -0
  170. data/lib/bolt/puppetdb/instance.rb +146 -0
  171. data/lib/bolt/puppetdb.rb +15 -0
  172. data/lib/bolt/r10k_log_proxy.rb +30 -0
  173. data/lib/bolt/rerun.rb +55 -0
  174. data/lib/bolt/resource_instance.rb +133 -0
  175. data/lib/bolt/result.rb +247 -0
  176. data/lib/bolt/result_set.rb +128 -0
  177. data/lib/bolt/shell/bash/tmpdir.rb +62 -0
  178. data/lib/bolt/shell/bash.rb +516 -0
  179. data/lib/bolt/shell/powershell/snippets.rb +181 -0
  180. data/lib/bolt/shell/powershell.rb +365 -0
  181. data/lib/bolt/shell.rb +105 -0
  182. data/lib/bolt/target.rb +174 -0
  183. data/lib/bolt/task/puppet_server.rb +27 -0
  184. data/lib/bolt/task/run.rb +55 -0
  185. data/lib/bolt/task.rb +163 -0
  186. data/lib/bolt/transport/base.rb +252 -0
  187. data/lib/bolt/transport/docker/connection.rb +150 -0
  188. data/lib/bolt/transport/docker.rb +23 -0
  189. data/lib/bolt/transport/jail/connection.rb +81 -0
  190. data/lib/bolt/transport/jail.rb +21 -0
  191. data/lib/bolt/transport/local/connection.rb +106 -0
  192. data/lib/bolt/transport/local.rb +20 -0
  193. data/lib/bolt/transport/lxd/connection.rb +115 -0
  194. data/lib/bolt/transport/lxd.rb +26 -0
  195. data/lib/bolt/transport/orch/connection.rb +111 -0
  196. data/lib/bolt/transport/orch.rb +271 -0
  197. data/lib/bolt/transport/podman/connection.rb +102 -0
  198. data/lib/bolt/transport/podman.rb +19 -0
  199. data/lib/bolt/transport/remote.rb +41 -0
  200. data/lib/bolt/transport/simple.rb +54 -0
  201. data/lib/bolt/transport/ssh/connection.rb +321 -0
  202. data/lib/bolt/transport/ssh/exec_connection.rb +140 -0
  203. data/lib/bolt/transport/ssh.rb +48 -0
  204. data/lib/bolt/transport/winrm/connection.rb +378 -0
  205. data/lib/bolt/transport/winrm.rb +33 -0
  206. data/lib/bolt/util/format.rb +68 -0
  207. data/lib/bolt/util/puppet_log_level.rb +21 -0
  208. data/lib/bolt/util.rb +465 -0
  209. data/lib/bolt/validator.rb +227 -0
  210. data/lib/bolt/version.rb +5 -0
  211. data/lib/bolt.rb +8 -0
  212. data/lib/bolt_server/acl.rb +39 -0
  213. data/lib/bolt_server/base_config.rb +112 -0
  214. data/lib/bolt_server/config.rb +64 -0
  215. data/lib/bolt_server/file_cache.rb +200 -0
  216. data/lib/bolt_server/request_error.rb +11 -0
  217. data/lib/bolt_server/schemas/action-check_node_connections.json +14 -0
  218. data/lib/bolt_server/schemas/action-run_command.json +12 -0
  219. data/lib/bolt_server/schemas/action-run_script.json +47 -0
  220. data/lib/bolt_server/schemas/action-run_task.json +20 -0
  221. data/lib/bolt_server/schemas/action-upload_file.json +47 -0
  222. data/lib/bolt_server/schemas/partials/target-any.json +10 -0
  223. data/lib/bolt_server/schemas/partials/target-ssh.json +88 -0
  224. data/lib/bolt_server/schemas/partials/target-winrm.json +67 -0
  225. data/lib/bolt_server/schemas/partials/task.json +94 -0
  226. data/lib/bolt_server/schemas/transport-ssh.json +25 -0
  227. data/lib/bolt_server/schemas/transport-winrm.json +19 -0
  228. data/lib/bolt_server/transport_app.rb +554 -0
  229. data/lib/bolt_spec/bolt_context.rb +226 -0
  230. data/lib/bolt_spec/plans/action_stubs/command_stub.rb +51 -0
  231. data/lib/bolt_spec/plans/action_stubs/download_stub.rb +66 -0
  232. data/lib/bolt_spec/plans/action_stubs/plan_stub.rb +55 -0
  233. data/lib/bolt_spec/plans/action_stubs/script_stub.rb +59 -0
  234. data/lib/bolt_spec/plans/action_stubs/task_stub.rb +57 -0
  235. data/lib/bolt_spec/plans/action_stubs/upload_stub.rb +65 -0
  236. data/lib/bolt_spec/plans/action_stubs.rb +196 -0
  237. data/lib/bolt_spec/plans/mock_executor.rb +361 -0
  238. data/lib/bolt_spec/plans/publish_stub.rb +49 -0
  239. data/lib/bolt_spec/plans.rb +190 -0
  240. data/lib/bolt_spec/run.rb +246 -0
  241. data/lib/logging_extensions/logging.rb +13 -0
  242. data/libexec/apply_catalog.rb +130 -0
  243. data/libexec/bolt_catalog +68 -0
  244. data/libexec/custom_facts.rb +63 -0
  245. data/libexec/query_resources.rb +75 -0
  246. data/modules/aggregate/lib/puppet/functions/aggregate/count.rb +21 -0
  247. data/modules/aggregate/lib/puppet/functions/aggregate/nodes.rb +22 -0
  248. data/modules/aggregate/lib/puppet/functions/aggregate/targets.rb +21 -0
  249. data/modules/aggregate/plans/count.pp +56 -0
  250. data/modules/aggregate/plans/targets.pp +56 -0
  251. data/modules/canary/lib/puppet/functions/canary/merge.rb +13 -0
  252. data/modules/canary/lib/puppet/functions/canary/random_split.rb +22 -0
  253. data/modules/canary/lib/puppet/functions/canary/skip.rb +25 -0
  254. data/modules/canary/plans/init.pp +100 -0
  255. data/modules/puppet_connect/plans/test_input_data.pp +94 -0
  256. data/modules/puppetdb_fact/plans/init.pp +20 -0
  257. data/resources/bolt_bash_completion.sh +214 -0
  258. metadata +735 -0
@@ -0,0 +1,673 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../bolt/config/transport/docker'
4
+ require_relative '../../bolt/config/transport/jail'
5
+ require_relative '../../bolt/config/transport/local'
6
+ require_relative '../../bolt/config/transport/lxd'
7
+ require_relative '../../bolt/config/transport/orch'
8
+ require_relative '../../bolt/config/transport/podman'
9
+ require_relative '../../bolt/config/transport/remote'
10
+ require_relative '../../bolt/config/transport/ssh'
11
+ require_relative '../../bolt/config/transport/winrm'
12
+
13
+ module Bolt
14
+ class Config
15
+ module Options
16
+ # Transport config classes. Used to load default transport config which
17
+ # gets passed along to the inventory.
18
+ TRANSPORT_CONFIG = {
19
+ 'docker' => Bolt::Config::Transport::Docker,
20
+ 'jail' => Bolt::Config::Transport::Jail,
21
+ 'local' => Bolt::Config::Transport::Local,
22
+ 'lxd' => Bolt::Config::Transport::LXD,
23
+ 'pcp' => Bolt::Config::Transport::Orch,
24
+ 'podman' => Bolt::Config::Transport::Podman,
25
+ 'remote' => Bolt::Config::Transport::Remote,
26
+ 'ssh' => Bolt::Config::Transport::SSH,
27
+ 'winrm' => Bolt::Config::Transport::WinRM
28
+ }.freeze
29
+
30
+ # Plugin definition. This is used by the JSON schemas to indicate that an option
31
+ # accepts a plugin reference. Since this isn't used by Bolt to perform automatic
32
+ # type validation, the :type key is set to a JSON type instead of a Ruby type.
33
+ PLUGIN = {
34
+ "_plugin" => {
35
+ description: "A plugin reference.",
36
+ type: "object",
37
+ required: ["_plugin"],
38
+ properties: {
39
+ "_plugin" => {
40
+ description: "The name of the plugin.",
41
+ type: "string"
42
+ },
43
+ "_cache" => {
44
+ description: "This feature is experimental. Enable plugin caching and set a time-to-live.",
45
+ type: "object",
46
+ required: ["ttl"],
47
+ properties: {
48
+ "ttl" => {
49
+ description: "Time in seconds to keep the plugin cache.",
50
+ type: "integer",
51
+ minimum: 0
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }.freeze
58
+
59
+ # PuppetDB options.
60
+ PUPPETDB_OPTIONS = {
61
+ "cacert" => {
62
+ description: "The path to the ca certificate for PuppetDB.",
63
+ type: String,
64
+ _example: "/etc/puppetlabs/puppet/ssl/certs/ca.pem",
65
+ _plugin: true
66
+ },
67
+ "cert" => {
68
+ description: "The path to the client certificate file to use for authentication.",
69
+ type: String,
70
+ _example: "/etc/puppetlabs/puppet/ssl/certs/my-host.example.com.pem",
71
+ _plugin: true
72
+ },
73
+ "connect_timeout" => {
74
+ description: "How long to wait in seconds when establishing connections with PuppetDB.",
75
+ type: Integer,
76
+ minimum: 1,
77
+ _default: 60,
78
+ _example: 120,
79
+ _plugin: true
80
+ },
81
+ "key" => {
82
+ description: "The private key for the certificate.",
83
+ type: String,
84
+ _example: "/etc/puppetlabs/puppet/ssl/private_keys/my-host.example.com.pem",
85
+ _plugin: true
86
+ },
87
+ "read_timeout" => {
88
+ description: "How long to wait in seconds for a response from PuppetDB.",
89
+ type: Integer,
90
+ minimum: 1,
91
+ _default: 60,
92
+ _example: 120,
93
+ _plugin: true
94
+ },
95
+ "server_urls" => {
96
+ description: "An array containing the PuppetDB host to connect to. Include the protocol `https` "\
97
+ "and the port, which is usually `8081`. For example, "\
98
+ "`https://my-puppetdb-server.com:8081`.",
99
+ type: Array,
100
+ _example: ["https://puppet.example.com:8081"],
101
+ _plugin: true
102
+ },
103
+ "token" => {
104
+ description: "The path to the PE RBAC Token.",
105
+ type: String,
106
+ _example: "~/.puppetlabs/token",
107
+ _plugin: true
108
+ }
109
+ }.freeze
110
+
111
+ # Definitions used to validate config options.
112
+ # https://github.com/puppetlabs/bolt/blob/main/schemas/README.md
113
+ OPTIONS = {
114
+ "analytics" => {
115
+ description: "Whether to disable analytics. Setting this option to 'false' in the system-wide "\
116
+ "or user-level configuration will disable analytics for all projects, even if this "\
117
+ "option is set to 'true' at the project level.",
118
+ type: [TrueClass, FalseClass],
119
+ _example: false
120
+ },
121
+ "apply-settings" => {
122
+ description: "A map of Puppet settings to use when applying Puppet code using the `apply` "\
123
+ "plan function or the `bolt apply` command.",
124
+ type: Hash,
125
+ properties: {
126
+ "evaltrace" => {
127
+ description: "Whether each resource should log when it is being evaluated. This allows "\
128
+ "you to interactively see exactly what is being done.",
129
+ type: [TrueClass, FalseClass],
130
+ _example: true,
131
+ _default: false
132
+ },
133
+ "log_level" => {
134
+ description: "The log level for logs in apply reports from Puppet. These can be seen "\
135
+ "in ApplyResults.",
136
+ type: String,
137
+ enum: %w[debug info notice warning err alert emerg crit],
138
+ _example: "debug",
139
+ _default: "notice"
140
+ },
141
+ "show_diff" => {
142
+ description: "Whether to log and report a contextual diff.",
143
+ type: [TrueClass, FalseClass],
144
+ _example: true,
145
+ _default: false
146
+ },
147
+ "trace" => {
148
+ description: "Whether to print stack traces on some errors. Will print internal Ruby "\
149
+ "stack trace interleaved with Puppet function frames.",
150
+ type: [TrueClass, FalseClass],
151
+ _example: true,
152
+ _default: false
153
+ }
154
+ },
155
+ _plugin: false
156
+ },
157
+ "color" => {
158
+ description: "Whether to use colored output when printing messages to the console.",
159
+ type: [TrueClass, FalseClass],
160
+ _plugin: false,
161
+ _example: false,
162
+ _default: true
163
+ },
164
+ "compile-concurrency" => {
165
+ description: "The maximum number of simultaneous manifest block compiles.",
166
+ type: Integer,
167
+ minimum: 1,
168
+ _plugin: false,
169
+ _example: 5,
170
+ _default: "Number of cores."
171
+ },
172
+ "concurrency" => {
173
+ description: "The number of threads to use when executing on remote targets.",
174
+ type: Integer,
175
+ minimum: 1,
176
+ _plugin: false,
177
+ _example: 50,
178
+ _default: "100 or 1/7 the ulimit, whichever is lower."
179
+ },
180
+ "disable-warnings" => {
181
+ description: "An array of IDs of warnings to suppress. Warnings with a matching ID will not be logged "\
182
+ "by Bolt. If you are upgrading Bolt to a new major version, you should re-enable all warnings "\
183
+ "until you have finished upgrading.",
184
+ type: Array,
185
+ items: {
186
+ type: String
187
+ },
188
+ _plugin: false,
189
+ _example: ["powershell_2"]
190
+ },
191
+ "format" => {
192
+ description: "The format to use when printing results.",
193
+ type: String,
194
+ enum: %w[human json rainbow],
195
+ _plugin: false,
196
+ _example: "json",
197
+ _default: "human"
198
+ },
199
+ "future" => {
200
+ description: "Enable new Bolt features that may include breaking changes.",
201
+ type: Hash,
202
+ properties: {
203
+ "file_paths" => {
204
+ description: "Load scripts from the `scripts/` directory of a module.",
205
+ type: [TrueClass, FalseClass],
206
+ _example: true,
207
+ _default: false,
208
+ _deprecation: "Bolt no longer honors this option and enables loading scripts from the scripts "\
209
+ "directory by default."
210
+ },
211
+ "script_interpreter" => {
212
+ description: "Use a target's [`interpreters` configuration](bolt_transports_reference.md#interpreters) "\
213
+ "when running a script.",
214
+ type: [TrueClass, FalseClass],
215
+ _example: true,
216
+ _default: false
217
+ }
218
+ },
219
+ _plugin: false,
220
+ _example: { 'script_interpreter' => true }
221
+ },
222
+ "hiera-config" => {
223
+ description: "The path to the Hiera configuration file.",
224
+ type: String,
225
+ _plugin: false,
226
+ _example: "~/.puppetlabs/bolt/hiera.yaml",
227
+ _default: "project/hiera.yaml"
228
+ },
229
+ "inventory-config" => {
230
+ description: "A map of default configuration options for the inventory. This includes options "\
231
+ "for setting the default transport to use when connecting to targets, as well as "\
232
+ "options for configuring the default behavior of each transport.",
233
+ type: Hash,
234
+ _plugin: false,
235
+ _example: {}
236
+ },
237
+ "plugin-cache" => {
238
+ description: "This feature is experimental. Enable plugin caching and set the time-to-live.",
239
+ type: Hash,
240
+ required: ["ttl"],
241
+ properties: {
242
+ "ttl" => {
243
+ description: "Time in seconds to keep the plugin cache.",
244
+ type: Integer,
245
+ minimum: 0
246
+ }
247
+ },
248
+ _plugin: false,
249
+ _example: { "ttl" => 3600 }
250
+ },
251
+ "log" => {
252
+ description: "A map of configuration for the logfile output. Under `log`, you can configure log options "\
253
+ "for `console` and add configuration for individual log files, such as "\
254
+ "`~/.puppetlabs/bolt/debug.log`. Individual log files must be valid filepaths. If the log "\
255
+ "file does not exist, then Bolt will create it before logging information. Set the value to "\
256
+ "`disable` to remove a log file defined at an earlier level of the config hierarchy. By "\
257
+ "default, Bolt logs to a bolt-debug.log file in the Bolt project directory.",
258
+ type: Hash,
259
+ properties: {
260
+ "console" => {
261
+ description: "Configuration for logs output to the console.",
262
+ type: [String, Hash],
263
+ enum: ['disable'],
264
+ properties: {
265
+ "level" => {
266
+ description: "The type of information to log.",
267
+ type: String,
268
+ enum: %w[trace debug error info warn fatal],
269
+ _default: "warn"
270
+ }
271
+ }
272
+ }
273
+ },
274
+ additionalProperties: {
275
+ description: "Configuration for the logfile output.",
276
+ type: [String, Hash],
277
+ enum: ['disable'],
278
+ properties: {
279
+ "append" => {
280
+ description: "Whether to append output to an existing log file.",
281
+ type: [TrueClass, FalseClass],
282
+ _default: true
283
+ },
284
+ "level" => {
285
+ description: "The type of information to log.",
286
+ type: String,
287
+ enum: %w[trace debug error info warn fatal],
288
+ _default: "warn"
289
+ }
290
+ }
291
+ },
292
+ _plugin: false,
293
+ _example: { "console" => { "level" => "info" },
294
+ "~/logs/debug.log" => { "append" => false, "level" => "debug" } }
295
+ },
296
+ "modulepath" => {
297
+ description: "An array of directories that Bolt loads content such as plans and tasks from. Read more "\
298
+ "about modules in [Module structure](module_structure.md).",
299
+ type: [Array, String],
300
+ items: {
301
+ type: String
302
+ },
303
+ _plugin: false,
304
+ _example: ["~/.puppetlabs/bolt/modules", "~/.puppetlabs/bolt/site-modules"],
305
+ _default: ["project/modules"]
306
+ },
307
+ "module-install" => {
308
+ description: "Options that configure where Bolt downloads modules from. This option is only used when "\
309
+ "installing modules using the `bolt module add|install` commands and "\
310
+ "`Add|Install-BoltModule` cmdlets.",
311
+ type: Hash,
312
+ properties: {
313
+ "forge" => {
314
+ description: "A subsection for configuring connections to a Forge host.",
315
+ type: Hash,
316
+ properties: {
317
+ "authorization_token" => {
318
+ description: "The token used to authorize requests to the Forge host. Must also specify "\
319
+ "`baseurl` when using this option.",
320
+ type: String,
321
+ _example: "Bearer eyJhbGciOiJIUzI1NiIsInR5c...",
322
+ _plugin: true
323
+ },
324
+ "baseurl" => {
325
+ description: "The URL to the Forge host.",
326
+ type: String,
327
+ format: "uri",
328
+ _example: "https://forge.example.com"
329
+ },
330
+ "proxy" => {
331
+ description: "The HTTP proxy to use for Forge operations.",
332
+ type: String,
333
+ format: "uri",
334
+ _example: "https://my-forge-proxy.com:8080"
335
+ }
336
+ },
337
+ _example: {
338
+ "authorization_token" => "Bearer eyJhbGciOiJIUzI1NiIsInR5c...",
339
+ "baseurl" => "https://forge.example.com",
340
+ "proxy" => "https://my-forge-proxy.com:8080"
341
+ }
342
+ },
343
+ "proxy" => {
344
+ description: "The HTTP proxy to use for Git and Forge operations.",
345
+ type: String,
346
+ format: "uri",
347
+ _example: "https://my-proxy.com:8080"
348
+ }
349
+ },
350
+ _plugin: false
351
+ },
352
+ "modules" => {
353
+ description: "A list of module dependencies for the project. Each dependency is a map of data specifying "\
354
+ "the module to install. To install the project's module dependencies, run the `bolt module "\
355
+ "install` command. For more information about specifying modules, see [the "\
356
+ "documentation](https://pup.pt/bolt-module-specs).",
357
+ type: Array,
358
+ items: {
359
+ type: [Hash, String],
360
+ oneOf: [
361
+ {
362
+ required: ["name"],
363
+ properties: {
364
+ "name" => {
365
+ description: "The name of the module.",
366
+ type: String
367
+ },
368
+ "resolve" => {
369
+ description: "Whether to resolve the module's dependencies when installing modules.",
370
+ type: [TrueClass, FalseClass]
371
+ },
372
+ "version_requirement" => {
373
+ description: "The version requirement for the module. Accepts a specific version (1.2.3), version "\
374
+ "shorthand (1.2.x), or a version range (>= 1.2.0).",
375
+ type: String
376
+ }
377
+ }
378
+ },
379
+ {
380
+ required: %w[git ref],
381
+ properties: {
382
+ "git" => {
383
+ description: "The URL to the public git repository.",
384
+ type: String
385
+ },
386
+ "name" => {
387
+ description: "The name of the module. Required when `resolve` is `false`.",
388
+ type: String
389
+ },
390
+ "ref" => {
391
+ description: "The git reference to check out. Can be either a branch, tag, or commit SHA.",
392
+ type: String
393
+ },
394
+ "resolve" => {
395
+ description: "Whether to resolve the module's dependencies when installing modules.",
396
+ type: [TrueClass, FalseClass]
397
+ }
398
+ }
399
+ }
400
+ ]
401
+ },
402
+ _plugin: false,
403
+ _default: [],
404
+ _example: [
405
+ "puppetlabs-facts",
406
+ { "name" => "puppetlabs-mysql" },
407
+ { "name" => "puppetlabs-apache", "version_requirement" => "5.5.0" },
408
+ { "name" => "puppetlabs-puppetdb", "version_requirement" => "7.x" },
409
+ { "name" => "puppetlabs-firewall", "version_requirement" => ">= 1.0.0 < 3.0.0" },
410
+ { "git" => "https://github.com/puppetlabs/puppetlabs-apt", "ref" => "7.6.0" }
411
+ ]
412
+ },
413
+ "name" => {
414
+ description: "The name of the Bolt project. When this option is configured, the project is considered a "\
415
+ "[Bolt project](projects.md), allowing Bolt to load content from the project directory "\
416
+ "as though it were a module.",
417
+ type: String,
418
+ _plugin: false,
419
+ _example: "myproject"
420
+ },
421
+ "plans" => {
422
+ description: "A list of plan names and glob patterns to filter the project's plans by. This option is used "\
423
+ "to limit the visibility of plans for users of the project. For example, project authors "\
424
+ "might want to limit the visibility of plans that are bundled with Bolt or plans that should "\
425
+ "only be run as part of another plan. When this option is not configured, all plans are "\
426
+ "visible. This option does not prevent users from running plans that are not part of this "\
427
+ "list.",
428
+ type: Array,
429
+ _plugin: false,
430
+ _example: ["myproject", "myproject::foo", "myproject::bar", "myproject::deploy::*"]
431
+ },
432
+ "plugin-hooks" => {
433
+ description: "A map of [plugin hooks](writing_plugins.md#hooks) and which plugins a hook should use. "\
434
+ "The only configurable plugin hook is `puppet_library`, which can use two possible plugins: "\
435
+ "[`puppet_agent`](https://github.com/puppetlabs/puppetlabs-puppet_agent#puppet_agentinstall) "\
436
+ "and [`task`](using_plugins.md#task).",
437
+ type: Hash,
438
+ _plugin: true,
439
+ _example: { "puppet_library" => { "plugin" => "puppet_agent", "version" => "6.15.0", "_run_as" => "root" } }
440
+ },
441
+ "plugins" => {
442
+ description: "A map of plugins and their configuration data, where each key is the name of a plugin and "\
443
+ "its value is a map of configuration data. Configurable options are specified by the plugin. "\
444
+ "Read more about configuring plugins in [Using plugins](using_plugins.md#configuring-plugins).",
445
+ type: Hash,
446
+ additionalProperties: {
447
+ type: Hash,
448
+ _plugin: true
449
+ },
450
+ _plugin: false,
451
+ _example: { "pkcs7" => { "keysize" => 1024 } }
452
+ },
453
+ "policies" => {
454
+ description: "A list of policy names and glob patterns to filter the project's policies by. This option "\
455
+ "is used to specify which policies are available to a project and can be applied to targets. "\
456
+ "When this option is not configured, policies are not available to the project and cannot "\
457
+ "be applied to targets.",
458
+ type: Array,
459
+ _plugin: false,
460
+ _example: ["myproject::apache", "myproject::postgres"]
461
+ },
462
+ "puppetdb" => {
463
+ description: "A map containing options for [configuring the Bolt PuppetDB "\
464
+ "client](bolt_connect_puppetdb.md).",
465
+ type: Hash,
466
+ properties: PUPPETDB_OPTIONS,
467
+ _plugin: true
468
+ },
469
+ "puppetdb-instances" => {
470
+ description: "A map of named PuppetDB instances and their configuration, where keys are the name "\
471
+ "of a PuppetDB instance and values are maps of configuration options. For more "\
472
+ "information, see [Connecting Bolt to PuppetDB](bolt_connect_puppetdb.md).",
473
+ type: Hash,
474
+ additionalProperties: {
475
+ type: Hash,
476
+ properties: PUPPETDB_OPTIONS
477
+ },
478
+ _plugin: true
479
+ },
480
+ "rerunfile" => {
481
+ description: "The path to the project's rerun file. The rerun file is used to store information "\
482
+ "about targets from the most recent run. Expands relative to the project directory.",
483
+ type: String,
484
+ _example: "/Users/bolt/project/rerun.json",
485
+ _plugin: true
486
+ },
487
+ "save-rerun" => {
488
+ description: "Whether to update `.rerun.json` in the Bolt project directory. If "\
489
+ "your target names include passwords, set this value to `false` to avoid "\
490
+ "writing passwords to disk.",
491
+ type: [TrueClass, FalseClass],
492
+ _plugin: false,
493
+ _example: false,
494
+ _default: true
495
+ },
496
+ "spinner" => {
497
+ description: "Whether to print a spinner to the console for long-running Bolt operations.",
498
+ type: [TrueClass, FalseClass],
499
+ _plugin: false,
500
+ _example: false,
501
+ _default: true
502
+ },
503
+ "stream" => {
504
+ description: "Whether to stream output from scripts and commands to the console. "\
505
+ "**This option is experimental**.",
506
+ type: [TrueClass, FalseClass],
507
+ _plugin: false,
508
+ _default: false,
509
+ _example: true
510
+ },
511
+ "tasks" => {
512
+ description: "A list of task names and glob patterns to filter the project's tasks by. This option is used "\
513
+ "to limit the visibility of tasks for users of the project. For example, project authors "\
514
+ "might want to limit the visibility of tasks that are bundled with Bolt or plans that should "\
515
+ "only be run as part of a larger workflow. When this option is not configured, all tasks "\
516
+ "are visible. This option does not prevent users from running tasks that are not part of "\
517
+ "this list.",
518
+ type: Array,
519
+ items: {
520
+ type: String
521
+ },
522
+ _plugin: false,
523
+ _example: ["myproject", "myproject::foo", "myproject::bar", "myproject::deploy_*"]
524
+ },
525
+ "trusted-external-command" => {
526
+ description: "The path to an executable on the Bolt controller that can produce external trusted facts. "\
527
+ "**External trusted facts are experimental in both Puppet and Bolt and this API might "\
528
+ "change or be removed.**",
529
+ type: String,
530
+ _plugin: false,
531
+ _example: "/etc/puppetlabs/facts/trusted_external.sh"
532
+ }
533
+ }.freeze
534
+
535
+ # Options that configure the inventory, specifically the default transport
536
+ # used by targets and the transports themselves. These options are used in
537
+ # bolt-defaults.yaml under 'inventory-config' and in inventory.yaml under
538
+ # 'config'.
539
+ INVENTORY_OPTIONS = {
540
+ "transport" => {
541
+ description: "The default transport to use when the transport for a target is not "\
542
+ "specified in the URI.",
543
+ type: String,
544
+ enum: TRANSPORT_CONFIG.keys,
545
+ _plugin: true,
546
+ _example: "winrm",
547
+ _default: "ssh"
548
+ },
549
+ "docker" => {
550
+ description: "A map of configuration options for the docker transport.",
551
+ type: Hash,
552
+ _plugin: true,
553
+ _example: { "cleanup" => false, "service-url" => "https://docker.example.com" }
554
+ },
555
+ "jail" => {
556
+ description: "A map of configuration options for the jail transport.",
557
+ type: Hash,
558
+ _plugin: true,
559
+ _example: { cleanup: false }
560
+ },
561
+ "local" => {
562
+ description: "A map of configuration options for the local transport. The set of available options is "\
563
+ "platform dependent.",
564
+ type: Hash,
565
+ _plugin: true,
566
+ _example: { "cleanup" => false, "tmpdir" => "/tmp/bolt" }
567
+ },
568
+ "lxd" => {
569
+ description: "A map of configuration options for the LXD transport. The LXD transport is "\
570
+ "experimental and might include breaking changes between minor versions.",
571
+ type: Hash,
572
+ _plugin: true,
573
+ _example: { cleanup: false }
574
+ },
575
+ "pcp" => {
576
+ description: "A map of configuration options for the pcp transport.",
577
+ type: Hash,
578
+ _plugin: true,
579
+ _example: { "job-poll-interval" => 15, "job-poll-timeout" => 30 }
580
+ },
581
+ "podman" => {
582
+ description: "A map of configuration options for the podman transport.",
583
+ type: Hash,
584
+ _plugin: true,
585
+ _example: { "cleanup" => false, "tmpdir" => "/mount/tmp" }
586
+ },
587
+ "remote" => {
588
+ description: "A map of configuration options for the remote transport.",
589
+ type: Hash,
590
+ additionalProperties: true,
591
+ _plugin: true,
592
+ _example: { "run-on" => "proxy_target" }
593
+ },
594
+ "ssh" => {
595
+ description: "A map of configuration options for the ssh transport.",
596
+ type: Hash,
597
+ _plugin: true,
598
+ _example: { "password" => "hunter2!", "user" => "bolt" }
599
+ },
600
+ "winrm" => {
601
+ description: "A map of configuration options for the winrm transport.",
602
+ type: Hash,
603
+ _plugin: true,
604
+ _example: { "password" => "hunter2!", "user" => "bolt" }
605
+ }
606
+ }.freeze
607
+
608
+ # Options that are available on the command line
609
+ # This only includes options where users can provide arbitrary
610
+ # values from the command-line, allowing the validator to check them
611
+ CLI_OPTIONS = %w[
612
+ compile-concurrency
613
+ concurrency
614
+ format
615
+ log
616
+ modulepath
617
+ transport
618
+ ].freeze
619
+
620
+ # Options that are available in a bolt-defaults.yaml file
621
+ DEFAULTS_OPTIONS = %w[
622
+ analytics
623
+ color
624
+ compile-concurrency
625
+ concurrency
626
+ disable-warnings
627
+ format
628
+ inventory-config
629
+ log
630
+ module-install
631
+ plugin-cache
632
+ plugin-hooks
633
+ plugins
634
+ puppetdb
635
+ puppetdb-instances
636
+ save-rerun
637
+ spinner
638
+ stream
639
+ ].freeze
640
+
641
+ # Options that are available in a bolt-project.yaml file
642
+ PROJECT_OPTIONS = %w[
643
+ analytics
644
+ apply-settings
645
+ color
646
+ compile-concurrency
647
+ concurrency
648
+ disable-warnings
649
+ format
650
+ future
651
+ hiera-config
652
+ log
653
+ modulepath
654
+ module-install
655
+ modules
656
+ name
657
+ plans
658
+ plugin-cache
659
+ plugin-hooks
660
+ plugins
661
+ policies
662
+ puppetdb
663
+ puppetdb-instances
664
+ rerunfile
665
+ save-rerun
666
+ spinner
667
+ stream
668
+ tasks
669
+ trusted-external-command
670
+ ].freeze
671
+ end
672
+ end
673
+ end