bolt 2.16.0 → 2.21.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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/Puppetfile +3 -1
  3. data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +20 -9
  4. data/bolt-modules/boltlib/lib/puppet/functions/download_file.rb +123 -0
  5. data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +2 -0
  6. data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +6 -0
  7. data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +6 -4
  8. data/bolt-modules/dir/lib/puppet/functions/dir/children.rb +35 -0
  9. data/lib/bolt/applicator.rb +19 -14
  10. data/lib/bolt/apply_result.rb +1 -1
  11. data/lib/bolt/bolt_option_parser.rb +60 -16
  12. data/lib/bolt/catalog.rb +3 -2
  13. data/lib/bolt/cli.rb +121 -43
  14. data/lib/bolt/config.rb +37 -34
  15. data/lib/bolt/config/options.rb +340 -173
  16. data/lib/bolt/config/transport/options.rb +315 -160
  17. data/lib/bolt/config/transport/ssh.rb +24 -10
  18. data/lib/bolt/executor.rb +21 -0
  19. data/lib/bolt/inventory/group.rb +3 -2
  20. data/lib/bolt/inventory/inventory.rb +4 -3
  21. data/lib/bolt/logger.rb +24 -1
  22. data/lib/bolt/outputter.rb +1 -1
  23. data/lib/bolt/outputter/rainbow.rb +14 -3
  24. data/lib/bolt/pal.rb +28 -10
  25. data/lib/bolt/pal/yaml_plan/evaluator.rb +23 -2
  26. data/lib/bolt/pal/yaml_plan/step.rb +24 -2
  27. data/lib/bolt/pal/yaml_plan/step/download.rb +38 -0
  28. data/lib/bolt/pal/yaml_plan/step/message.rb +30 -0
  29. data/lib/bolt/pal/yaml_plan/step/upload.rb +3 -3
  30. data/lib/bolt/plugin/module.rb +2 -4
  31. data/lib/bolt/plugin/puppetdb.rb +3 -2
  32. data/lib/bolt/project.rb +20 -6
  33. data/lib/bolt/puppetdb/client.rb +2 -0
  34. data/lib/bolt/puppetdb/config.rb +16 -0
  35. data/lib/bolt/result.rb +7 -0
  36. data/lib/bolt/shell/bash.rb +45 -37
  37. data/lib/bolt/shell/powershell.rb +21 -11
  38. data/lib/bolt/shell/powershell/snippets.rb +15 -6
  39. data/lib/bolt/transport/base.rb +24 -0
  40. data/lib/bolt/transport/docker.rb +16 -4
  41. data/lib/bolt/transport/docker/connection.rb +20 -2
  42. data/lib/bolt/transport/local/connection.rb +14 -1
  43. data/lib/bolt/transport/orch.rb +20 -0
  44. data/lib/bolt/transport/simple.rb +6 -0
  45. data/lib/bolt/transport/ssh.rb +7 -1
  46. data/lib/bolt/transport/ssh/connection.rb +9 -1
  47. data/lib/bolt/transport/ssh/exec_connection.rb +23 -2
  48. data/lib/bolt/transport/winrm/connection.rb +118 -8
  49. data/lib/bolt/util.rb +26 -11
  50. data/lib/bolt/version.rb +1 -1
  51. data/lib/bolt_server/transport_app.rb +3 -2
  52. data/lib/bolt_spec/bolt_context.rb +7 -2
  53. data/lib/bolt_spec/plans.rb +15 -2
  54. data/lib/bolt_spec/plans/action_stubs.rb +2 -1
  55. data/lib/bolt_spec/plans/action_stubs/download_stub.rb +66 -0
  56. data/lib/bolt_spec/plans/mock_executor.rb +14 -1
  57. data/lib/bolt_spec/run.rb +22 -0
  58. data/libexec/bolt_catalog +3 -2
  59. data/modules/secure_env_vars/plans/init.pp +20 -0
  60. metadata +21 -29
@@ -1,148 +1,377 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'bolt/config/transport/ssh'
4
+ require 'bolt/config/transport/winrm'
5
+ require 'bolt/config/transport/orch'
6
+ require 'bolt/config/transport/local'
7
+ require 'bolt/config/transport/docker'
8
+ require 'bolt/config/transport/remote'
9
+
3
10
  module Bolt
4
11
  class Config
5
12
  module Options
13
+ # Transport config classes. Used to load default transport config which
14
+ # gets passed along to the inventory.
15
+ TRANSPORT_CONFIG = {
16
+ 'ssh' => Bolt::Config::Transport::SSH,
17
+ 'winrm' => Bolt::Config::Transport::WinRM,
18
+ 'pcp' => Bolt::Config::Transport::Orch,
19
+ 'local' => Bolt::Config::Transport::Local,
20
+ 'docker' => Bolt::Config::Transport::Docker,
21
+ 'remote' => Bolt::Config::Transport::Remote
22
+ }.freeze
23
+
24
+ # Plugin definition. This is used by the JSON schemas to indicate that an option
25
+ # accepts a plugin reference. Since this isn't used by Bolt to perform automatic
26
+ # type validation, the :type key is set to a JSON type instead of a Ruby type.
27
+ PLUGIN = {
28
+ "_plugin" => {
29
+ description: "A plugin reference.",
30
+ type: "object",
31
+ required: ["_plugin"],
32
+ properties: {
33
+ "_plugin" => {
34
+ description: "The name of the plugin.",
35
+ type: "string"
36
+ }
37
+ }
38
+ }
39
+ }.freeze
40
+
6
41
  # The following constants define the various configuration options available to Bolt.
7
42
  # Each constant is a hash where keys are the configuration option and values are the
8
- # data describing the option. Data includes the following keys:
9
- # :def The **documented** default value. This is the value that is displayed
10
- # in the reference docs and is not used by Bolt to actually set a default
11
- # value.
12
- # :desc The text description of the option that is displayed in documentation.
13
- # :exmp An example value for the option. This is used to generate an example
14
- # configuration file in the reference docs.
15
- # :type The option's expected type. If an option accepts multiple types, this is
16
- # an array of the accepted types. Any options that accept a Boolean value
17
- # should use the [TrueClass, FalseClass] type.
43
+ # option's definition. These options are used in multiple locations:
44
+ #
45
+ # - Automatic type validation when loading and setting configuration
46
+ # - Generating reference documentation for configuration files
47
+ # - Generating JSON schemas for configuration files
48
+ #
49
+ # Data includes keys defined by JSON Schema Draft 07 as well as some metadata used
50
+ # by Bolt to generate documentation. The following keys are used:
51
+ #
52
+ # :description String A detailed description of the option and what it does. This
53
+ # field is used in both documentation and the JSON schemas,
54
+ # and should provide as much detail as possible, including
55
+ # links to relevant documentation.
56
+ #
57
+ # :type Class The expected type of a value. These should be Ruby classes,
58
+ # as this field is used to perform automatic type validation.
59
+ # If an option can accept more than one type, this should be
60
+ # an array of types. Boolean values should set :type to
61
+ # [TrueClass, FalseClass], as Ruby does not have a single
62
+ # Boolean class.
63
+ #
64
+ # :items Hash A definition hash for items in an array. Similar to values
65
+ # for top-level options, items can have a :description, :type,
66
+ # or any other key in this list.
67
+ #
68
+ # :uniqueItems Boolean Whether or not an array should contain only unique items.
69
+ #
70
+ # :properties Hash A hash where keys are sub-options and values are definitions
71
+ # for the sub-option. Similar to values for top-level options,
72
+ # properties can have a :description, :type, or any other key
73
+ # in this list.
74
+ #
75
+ # :additionalProperties A variation of the :properties key, where the hash is a
76
+ # Hash definition for any properties not specified in :properties.
77
+ # This can be used to permit arbitrary sub-options, such as
78
+ # logs for the 'log' option.
79
+ #
80
+ # :required Array An array of properties that are required for options that
81
+ # accept Hash values.
82
+ #
83
+ # :minimum Integer The minimum integer value for an option.
84
+ #
85
+ # :enum Array An array of values that the option recognizes.
86
+ #
87
+ # :pattern String A JSON regex pattern that the option's vaue should match.
88
+ #
89
+ # :format String Requires that a string value matches a format defined by the
90
+ # JSON Schema draft.
91
+ #
92
+ # :_plugin Boolean Whether the option accepts a plugin reference. This is used
93
+ # when generating the JSON schemas to determine whether or not
94
+ # to include a reference to the _plugin definition. If :_plugin
95
+ # is set to true, the script that generates JSON schemas will
96
+ # automatically recurse through the :items and :properties keys
97
+ # and add plugin references if applicable.
98
+ #
99
+ # :_example Any An example value for the option. This is used to generate
100
+ # reference documentation for configuration files.
101
+ #
102
+ # :_default Any The documented default value for the option. This is only
103
+ # used to generate reference documentation for configuration
104
+ # files and is not used by Bolt to actually set default values.
18
105
  OPTIONS = {
19
106
  "apply_settings" => {
20
- desc: "A map of Puppet settings to use when applying Puppet code using the `apply` "\
21
- "plan function or the `bolt apply` command.",
22
- type: Hash
107
+ description: "A map of Puppet settings to use when applying Puppet code using the `apply` "\
108
+ "plan function or the `bolt apply` command.",
109
+ type: Hash,
110
+ properties: {
111
+ "show_diff" => {
112
+ description: "Whether to log and report a contextual diff.",
113
+ type: [TrueClass, FalseClass],
114
+ _example: true,
115
+ _default: false
116
+ }
117
+ },
118
+ _plugin: false
23
119
  },
24
120
  "color" => {
25
- desc: "Whether to use colored output when printing messages to the console.",
121
+ description: "Whether to use colored output when printing messages to the console.",
26
122
  type: [TrueClass, FalseClass],
27
- exmp: false,
28
- def: true
123
+ _plugin: false,
124
+ _example: false,
125
+ _default: true
29
126
  },
30
127
  "compile-concurrency" => {
31
- desc: "The maximum number of simultaneous manifest block compiles.",
128
+ description: "The maximum number of simultaneous manifest block compiles.",
32
129
  type: Integer,
33
- exmp: 4,
34
- def: "Number of cores."
130
+ minimum: 1,
131
+ _plugin: false,
132
+ _example: 5,
133
+ _default: "Number of cores."
35
134
  },
36
135
  "concurrency" => {
37
- desc: "The number of threads to use when executing on remote targets.",
136
+ description: "The number of threads to use when executing on remote targets.",
38
137
  type: Integer,
39
- exmp: 50,
40
- def: "100 or 1/7 the ulimit, whichever is lower."
138
+ minimum: 1,
139
+ _plugin: false,
140
+ _example: 50,
141
+ _default: "100 or 1/7 the ulimit, whichever is lower."
41
142
  },
42
143
  "format" => {
43
- desc: "The format to use when printing results. Options are `human`, `json`, and `rainbow`.",
144
+ description: "The format to use when printing results.",
44
145
  type: String,
45
- exmp: "json",
46
- def: "human"
146
+ enum: %w[human json rainbow],
147
+ _plugin: false,
148
+ _example: "json",
149
+ _default: "human"
47
150
  },
48
151
  "hiera-config" => {
49
- desc: "The path to your Hiera config.",
152
+ description: "The path to the Hiera configuration file.",
50
153
  type: String,
51
- def: "project/hiera.yaml",
52
- exmp: "~/.puppetlabs/bolt/hiera.yaml"
154
+ _plugin: false,
155
+ _example: "~/.puppetlabs/bolt/hiera.yaml",
156
+ _default: "project/hiera.yaml"
53
157
  },
54
158
  "inventory-config" => {
55
- desc: "A map of default configuration options for the inventory. This includes options "\
56
- "for setting the default transport to use when connecting to targets, as well as "\
57
- "options for configuring the default behavior of each transport.",
58
- type: Hash
159
+ description: "A map of default configuration options for the inventory. This includes options "\
160
+ "for setting the default transport to use when connecting to targets, as well as "\
161
+ "options for configuring the default behavior of each transport.",
162
+ type: Hash,
163
+ _plugin: false,
164
+ _example: {}
59
165
  },
60
166
  "inventoryfile" => {
61
- desc: "The path to a structured data inventory file used to refer to groups of targets on the command "\
62
- "line and from plans. Read more about using inventory files in [Inventory "\
63
- "files](inventory_file_v2.md).",
167
+ description: "The path to a structured data inventory file used to refer to groups of targets on the "\
168
+ "command line and from plans. Read more about using inventory files in [Inventory "\
169
+ "files](inventory_file_v2.md).",
64
170
  type: String,
65
- def: "project/inventory.yaml",
66
- exmp: "~/.puppetlabs/bolt/inventory.yaml"
171
+ _plugin: false,
172
+ _example: "~/.puppetlabs/bolt/inventory.yaml",
173
+ _default: "project/inventory.yaml"
67
174
  },
68
175
  "log" => {
69
- desc: "A map of configuration for the logfile output. Configuration can be set for "\
70
- "`console` and individual log files, such as `~/.puppetlabs/bolt/debug.log`. "\
71
- "Each key in the map is the logfile output to configure, with the corresponding "\
72
- "value configuring the logfile output.",
176
+ description: "A map of configuration for the logfile output. Under `log`, you can configure log options "\
177
+ "for `console` and add configuration for individual log files, such as "\
178
+ "`~/.puppetlabs/bolt/debug.log`. Individual log files must be valid filepaths. If the log "\
179
+ "file does not exist, then Bolt will create it before logging information.",
73
180
  type: Hash,
74
- exmp: { "console" => { "level" => "info" },
75
- "~/logs/debug.log" => { "append" => false, "level" => "debug" } }
181
+ properties: {
182
+ "console" => {
183
+ description: "Configuration for logs output to the console.",
184
+ type: Hash,
185
+ properties: {
186
+ "level" => {
187
+ description: "The type of information to log.",
188
+ type: String,
189
+ enum: %w[debug error info notice warn fatal any],
190
+ _default: "warn for console, notice for file"
191
+ }
192
+ }
193
+ }
194
+ },
195
+ additionalProperties: {
196
+ description: "Configuration for the logfile output.",
197
+ type: Hash,
198
+ properties: {
199
+ "append" => {
200
+ description: "Whether to append output to an existing log file.",
201
+ type: [TrueClass, FalseClass],
202
+ _default: true
203
+ },
204
+ "level" => {
205
+ description: "The type of information to log.",
206
+ type: String,
207
+ enum: %w[debug error info notice warn fatal any],
208
+ _default: "warn for console, notice for file"
209
+ }
210
+ }
211
+ },
212
+ _plugin: false,
213
+ _example: { "console" => { "level" => "info" },
214
+ "~/logs/debug.log" => { "append" => false, "level" => "debug" } }
76
215
  },
77
216
  "modulepath" => {
78
- desc: "An array of directories that Bolt loads content such as plans and tasks from. Read more "\
79
- "about modules in [Module structure](module_structure.md).",
217
+ description: "An array of directories that Bolt loads content such as plans and tasks from. Read more "\
218
+ "about modules in [Module structure](module_structure.md).",
80
219
  type: [Array, String],
81
- def: ["project/modules", "project/site-modules", "project/site"],
82
- exmp: ["~/.puppetlabs/bolt/modules", "~/.puppetlabs/bolt/site-modules"]
220
+ items: {
221
+ type: String
222
+ },
223
+ _plugin: false,
224
+ _example: ["~/.puppetlabs/bolt/modules", "~/.puppetlabs/bolt/site-modules"],
225
+ _default: ["project/modules", "project/site-modules", "project/site"]
83
226
  },
84
227
  "name" => {
85
- desc: "The name of the Bolt project. When this option is configured, the project is considered a "\
86
- "[Bolt project](experimental_features.md#bolt-projects), allowing Bolt to load content from "\
87
- "the project directory as though it were a module.",
228
+ description: "The name of the Bolt project. When this option is configured, the project is considered a "\
229
+ "[Bolt project](experimental_features.md#bolt-projects), allowing Bolt to load content from "\
230
+ "the project directory as though it were a module.",
88
231
  type: String,
89
- exmp: "myproject"
232
+ _plugin: false,
233
+ _example: "myproject"
90
234
  },
91
235
  "plans" => {
92
- desc: "A list of plan names to show in `bolt plan show` output, if they exist. This option is used to "\
93
- "limit the visibility of plans for users of the project. For example, project authors might want to "\
94
- "limit the visibility of plans that are bundled with Bolt or plans that should only be run as "\
95
- "part of another plan. When this option is not configured, all plans are visible. This "\
96
- "option does not prevent users from running plans that are not part of this list.",
236
+ description: "A list of plan names to show in `bolt plan show` output, if they exist. This option is used "\
237
+ "to limit the visibility of plans for users of the project. For example, project authors "\
238
+ "might want to limit the visibility of plans that are bundled with Bolt or plans that should "\
239
+ "only be run as part of another plan. When this option is not configured, all plans are "\
240
+ "visible. This option does not prevent users from running plans that are not part of this "\
241
+ "list.",
97
242
  type: Array,
98
- exmp: ["myproject", "myproject::foo", "myproject::bar"]
243
+ _plugin: false,
244
+ _example: ["myproject", "myproject::foo", "myproject::bar"]
99
245
  },
100
246
  "plugin_hooks" => {
101
- desc: "A map of [plugin hooks](writing_plugins.md#hooks) and which plugins a hook should use. "\
102
- "The only configurable plugin hook is `puppet_library`, which can use two possible plugins: "\
103
- "[`puppet_agent`](https://github.com/puppetlabs/puppetlabs-puppet_agent#puppet_agentinstall) "\
104
- "and [`task`](using_plugins.md#task).",
247
+ description: "A map of [plugin hooks](writing_plugins.md#hooks) and which plugins a hook should use. "\
248
+ "The only configurable plugin hook is `puppet_library`, which can use two possible plugins: "\
249
+ "[`puppet_agent`](https://github.com/puppetlabs/puppetlabs-puppet_agent#puppet_agentinstall) "\
250
+ "and [`task`](using_plugins.md#task).",
105
251
  type: Hash,
106
- exmp: { "puppet_library" => { "plugin" => "puppet_agent", "version" => "6.15.0", "_run_as" => "root" } }
252
+ _plugin: true,
253
+ _example: { "puppet_library" => { "plugin" => "puppet_agent", "version" => "6.15.0", "_run_as" => "root" } }
107
254
  },
108
255
  "plugins" => {
109
- desc: "A map of plugins and their configuration data, where each key is the name of a plugin and its "\
110
- "value is a map of configuration data. Configurable options are specified by the plugin. Read "\
111
- "more about configuring plugins in [Using plugins](using_plugins.md#configuring-plugins).",
256
+ description: "A map of plugins and their configuration data, where each key is the name of a plugin and "\
257
+ "its value is a map of configuration data. Configurable options are specified by the plugin. "\
258
+ "Read more about configuring plugins in [Using plugins](using_plugins.md#configuring-plugins).",
112
259
  type: Hash,
113
- exmp: { "pkcs7" => { "keysize" => 1024 } }
260
+ _plugin: true,
261
+ _example: { "pkcs7" => { "keysize" => 1024 } }
114
262
  },
115
263
  "puppetdb" => {
116
- desc: "A map containing options for [configuring the Bolt PuppetDB client](bolt_connect_puppetdb.md).",
117
- type: Hash
264
+ description: "A map containing options for [configuring the Bolt PuppetDB "\
265
+ "client](bolt_connect_puppetdb.md).",
266
+ type: Hash,
267
+ properties: {
268
+ "cacert" => {
269
+ description: "The path to the ca certificate for PuppetDB.",
270
+ type: String,
271
+ _example: "/etc/puppetlabs/puppet/ssl/certs/ca.pem"
272
+ },
273
+ "cert" => {
274
+ description: "The path to the client certificate file to use for authentication.",
275
+ type: String,
276
+ _example: "/etc/puppetlabs/puppet/ssl/certs/my-host.example.com.pem"
277
+ },
278
+ "connect_timeout" => {
279
+ description: "How long to wait in seconds when establishing connections with PuppetDB.",
280
+ type: Integer,
281
+ minimum: 1,
282
+ _default: 60,
283
+ _example: 120
284
+ },
285
+ "key" => {
286
+ description: "The private key for the certificate.",
287
+ type: String,
288
+ _example: "/etc/puppetlabs/puppet/ssl/private_keys/my-host.example.com.pem"
289
+ },
290
+ "read_timeout" => {
291
+ description: "How long to wait in seconds for a response from PuppetDB.",
292
+ type: Integer,
293
+ minimum: 1,
294
+ _default: 60,
295
+ _example: 120
296
+ },
297
+ "server_urls" => {
298
+ description: "An array containing the PuppetDB host to connect to. Include the protocol `https` "\
299
+ "and the port, which is usually `8081`. For example, "\
300
+ "`https://my-master.example.com:8081`.",
301
+ type: Array,
302
+ _example: ["https://puppet.example.com:8081"]
303
+ },
304
+ "token" => {
305
+ description: "The path to the PE RBAC Token.",
306
+ type: String,
307
+ _example: "~/.puppetlabs/token"
308
+ }
309
+ },
310
+ _plugin: true
118
311
  },
119
312
  "puppetfile" => {
120
- desc: "A map containing options for the `bolt puppetfile install` command.",
121
- type: Hash
313
+ description: "A map containing options for the `bolt puppetfile install` command.",
314
+ type: Hash,
315
+ properties: {
316
+ "forge" => {
317
+ description: "A subsection that can have its own `proxy` setting to set an HTTP proxy for Forge "\
318
+ "operations only, and a `baseurl` setting to specify a different Forge host.",
319
+ type: Hash,
320
+ properties: {
321
+ "baseurl" => {
322
+ description: "The URL to the Forge host.",
323
+ type: String,
324
+ format: "uri",
325
+ _example: "https://forge.example.com"
326
+ },
327
+ "proxy" => {
328
+ description: "The HTTP proxy to use for Git and Forge operations.",
329
+ type: String,
330
+ format: "uri",
331
+ _example: "https://forgeapi.example.com"
332
+ }
333
+ },
334
+ _example: { "baseurl" => "https://forge.example.com", "proxy" => "https://forgeapi.example.com" }
335
+ },
336
+ "proxy" => {
337
+ description: "The HTTP proxy to use for Git and Forge operations.",
338
+ type: String,
339
+ format: "uri",
340
+ _example: "https://forgeapi.example.com"
341
+ }
342
+ },
343
+ _plugin: false
122
344
  },
123
345
  "save-rerun" => {
124
- desc: "Whether to update `.rerun.json` in the Bolt project directory. If "\
125
- "your target names include passwords, set this value to `false` to avoid "\
126
- "writing passwords to disk.",
346
+ description: "Whether to update `.rerun.json` in the Bolt project directory. If "\
347
+ "your target names include passwords, set this value to `false` to avoid "\
348
+ "writing passwords to disk.",
127
349
  type: [TrueClass, FalseClass],
128
- exmp: false,
129
- def: true
350
+ _plugin: false,
351
+ _example: false,
352
+ _default: true
130
353
  },
131
354
  "tasks" => {
132
- desc: "A list of task names to show in `bolt task show` output, if they exist. This option is used to "\
133
- "limit the visibility of tasks for users of the project. For example, project authors might want to "\
134
- "limit the visibility of tasks that are bundled with Bolt or plans that should only be run as "\
135
- "part of a larger workflow. When this option is not configured, all tasks are visible. This "\
136
- "option does not prevent users from running tasks that are not part of this list.",
355
+ description: "A list of task names to show in `bolt task show` output, if they exist. This option is used "\
356
+ "to limit the visibility of tasks for users of the project. For example, project authors "\
357
+ "might want to limit the visibility of tasks that are bundled with Bolt or plans that should "\
358
+ "only be run as part of a larger workflow. When this option is not configured, all tasks "\
359
+ "are visible. This option does not prevent users from running tasks that are not part of "\
360
+ "this list.",
137
361
  type: Array,
138
- exmp: ["myproject", "myproject::foo", "myproject::bar"]
362
+ items: {
363
+ type: String
364
+ },
365
+ _plugin: false,
366
+ _example: ["myproject", "myproject::foo", "myproject::bar"]
139
367
  },
140
368
  "trusted-external-command" => {
141
- desc: "The path to an executable on the Bolt controller that can produce external trusted facts. "\
142
- "**External trusted facts are experimental in both Puppet and Bolt and this API may change or "\
143
- "be removed.**",
369
+ description: "The path to an executable on the Bolt controller that can produce external trusted facts. "\
370
+ "**External trusted facts are experimental in both Puppet and Bolt and this API may change or "\
371
+ "be removed.**",
144
372
  type: String,
145
- exmp: "/etc/puppetlabs/facts/trusted_external.sh"
373
+ _plugin: false,
374
+ _example: "/etc/puppetlabs/facts/trusted_external.sh"
146
375
  }
147
376
  }.freeze
148
377
 
@@ -152,113 +381,50 @@ module Bolt
152
381
  # 'inventory-config' key in bolt-defaults.yaml.
153
382
  INVENTORY_OPTIONS = {
154
383
  "transport" => {
155
- desc: "The default transport to use when the transport for a target is not "\
156
- "specified in the URI.",
384
+ description: "The default transport to use when the transport for a target is not "\
385
+ "specified in the URI.",
157
386
  type: String,
158
- def: "ssh",
159
- exmp: "winrm"
387
+ enum: TRANSPORT_CONFIG.keys,
388
+ _plugin: false,
389
+ _example: "winrm",
390
+ _default: "ssh"
160
391
  },
161
392
  "docker" => {
162
- desc: "A map of configuration options for the docker transport.",
393
+ description: "A map of configuration options for the docker transport.",
163
394
  type: Hash,
164
- exmp: { "cleanup" => false, "service-url" => "https://docker.example.com" }
395
+ _plugin: true,
396
+ _example: { "cleanup" => false, "service-url" => "https://docker.example.com" }
165
397
  },
166
398
  "local" => {
167
- desc: "A map of configuration options for the local transport. The set of available options is "\
168
- "platform dependent.",
399
+ description: "A map of configuration options for the local transport. The set of available options is "\
400
+ "platform dependent.",
169
401
  type: Hash,
170
- exmp: { "cleanup" => false, "tmpdir" => "/tmp/bolt" }
402
+ _plugin: true,
403
+ _example: { "cleanup" => false, "tmpdir" => "/tmp/bolt" }
171
404
  },
172
405
  "pcp" => {
173
- desc: "A map of configuration options for the pcp transport.",
406
+ description: "A map of configuration options for the pcp transport.",
174
407
  type: Hash,
175
- exmp: { "job-poll-interval" => 15, "job-poll-timeout" => 30 }
408
+ _plugin: true,
409
+ _example: { "job-poll-interval" => 15, "job-poll-timeout" => 30 }
176
410
  },
177
411
  "remote" => {
178
- desc: "A map of configuration options for the remote transport.",
412
+ description: "A map of configuration options for the remote transport.",
179
413
  type: Hash,
180
- exmp: { "run-on" => "proxy_target" }
414
+ _plugin: true,
415
+ _example: { "run-on" => "proxy_target" }
181
416
  },
182
417
  "ssh" => {
183
- desc: "A map of configuration options for the ssh transport.",
418
+ description: "A map of configuration options for the ssh transport.",
184
419
  type: Hash,
185
- exmp: { "password" => "hunter2!", "user" => "bolt" }
420
+ _plugin: true,
421
+ _example: { "password" => "hunter2!", "user" => "bolt" }
186
422
  },
187
423
  "winrm" => {
188
- desc: "A map of configuration options for the winrm transport.",
424
+ description: "A map of configuration options for the winrm transport.",
189
425
  type: Hash,
190
- exmp: { "password" => "hunter2!", "user" => "bolt" }
191
- }
192
- }.freeze
193
-
194
- # Suboptions for options that accept hashes.
195
- SUBOPTIONS = {
196
- "apply_settings" => {
197
- "show_diff" => {
198
- desc: "Whether to log and report a contextual diff when files are being replaced. See "\
199
- "[Puppet documentation](https://puppet.com/docs/puppet/latest/configuration.html#showdiff) "\
200
- "for details.",
201
- type: [TrueClass, FalseClass],
202
- exmp: true,
203
- def: false
204
- }
205
- },
206
- "inventory-config" => INVENTORY_OPTIONS,
207
- "log" => {
208
- "append" => {
209
- desc: "Add output to an existing log file. Available only for logs output to a "\
210
- "filepath.",
211
- type: [TrueClass, FalseClass],
212
- def: true
213
- },
214
- "level" => {
215
- desc: "The type of information in the log. Either `debug`, `info`, `notice`, "\
216
- "`warn`, or `error`.",
217
- type: String,
218
- def: "`warn` for console, `notice` for file"
219
- }
220
- },
221
- "puppetdb" => {
222
- "cacert" => {
223
- desc: "The path to the ca certificate for PuppetDB.",
224
- type: String,
225
- exmp: "/etc/puppetlabs/puppet/ssl/certs/ca.pem"
226
- },
227
- "cert" => {
228
- desc: "The path to the client certificate file to use for authentication.",
229
- type: String,
230
- exmp: "/etc/puppetlabs/puppet/ssl/certs/my-host.example.com.pem"
231
- },
232
- "key" => {
233
- desc: "The private key for the certificate.",
234
- type: String,
235
- exmp: "/etc/puppetlabs/puppet/ssl/private_keys/my-host.example.com.pem"
236
- },
237
- "server_urls" => {
238
- desc: "An array containing the PuppetDB host to connect to. Include the protocol `https` "\
239
- "and the port, which is usually `8081`. For example, "\
240
- "`https://my-master.example.com:8081`.",
241
- type: Array,
242
- exmp: ["https://puppet.example.com:8081"]
243
- },
244
- "token" => {
245
- desc: "The path to the PE RBAC Token.",
246
- type: String,
247
- exmp: "~/.puppetlabs/token"
248
- }
249
- },
250
- "puppetfile" => {
251
- "forge" => {
252
- desc: "A subsection that can have its own `proxy` setting to set an HTTP proxy for Forge "\
253
- "operations only, and a `baseurl` setting to specify a different Forge host.",
254
- type: Hash,
255
- exmp: { "baseurl" => "https://forge.example.com", "proxy" => "https://forgeapi.example.com" }
256
- },
257
- "proxy" => {
258
- desc: "The HTTP proxy to use for Git and Forge operations.",
259
- type: String,
260
- exmp: "https://forgeapi.example.com"
261
- }
426
+ _plugin: true,
427
+ _example: { "password" => "hunter2!", "user" => "bolt" }
262
428
  }
263
429
  }.freeze
264
430
 
@@ -288,6 +454,7 @@ module Bolt
288
454
  concurrency
289
455
  format
290
456
  inventory-config
457
+ log
291
458
  plugin_hooks
292
459
  plugins
293
460
  puppetdb