bolt 2.16.0 → 2.17.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.

@@ -6,290 +6,439 @@ module Bolt
6
6
  module Options
7
7
  LOGIN_SHELLS = %w[sh bash zsh dash ksh powershell].freeze
8
8
 
9
- # The following constant defines the various configuration options available to Bolt's.
10
- # transports. Each key is a configuration option and values are the data describing the
11
- # option. Data includes the following keys:
12
- # :def The **documented** default value. This is the value that is displayed
13
- # in the reference docs and is not used by Bolt to actually set a default
14
- # value.
15
- # :desc The text description of the option that is displayed in documentation.
16
- # :exmp An example value for the option. This is used to generate an example
17
- # configuration file in the reference docs.
18
- # :type The option's expected type. If an option accepts multiple types, this is
19
- # an array of the accepted types. Any options that accept a Boolean value
20
- # should use the [TrueClass, FalseClass] type.
9
+ # The following constants define the various configuration options available to Bolt's
10
+ # transports. Each constant is a hash where keys are the configuration option and values
11
+ # are the option's definition. These options are used in multiple locations:
21
12
  #
22
- # NOTE: All transport configuration options should have a corresponding schema definition
23
- # in schemas/bolt-transport-definitions.json
13
+ # - Automatic type validation when loading and setting configuration
14
+ # - Generating reference documentation for configuration files
15
+ # - Generating JSON schemas for configuration files
16
+ #
17
+ # Data includes keys defined by JSON Schema Draft 07 as well as some metadata used
18
+ # by Bolt to generate documentation. The following keys are used:
19
+ #
20
+ # :description String A detailed description of the option and what it does. This
21
+ # field is used in both documentation and the JSON schemas,
22
+ # and should provide as much detail as possible, including
23
+ # links to relevant documentation.
24
+ #
25
+ # :type Class The expected type of a value. These should be Ruby classes,
26
+ # as this field is used to perform automatic type validation.
27
+ # If an option can accept more than one type, this should be
28
+ # an array of types. Boolean values should set :type to
29
+ # [TrueClass, FalseClass], as Ruby does not have a single
30
+ # Boolean class.
31
+ #
32
+ # :items Hash A definition hash for items in an array. Similar to values
33
+ # for top-level options, items can have a :description, :type,
34
+ # or any other key in this list.
35
+ #
36
+ # :uniqueItems Boolean Whether or not an array should contain only unique items.
37
+ #
38
+ # :properties Hash A hash where keys are sub-options and values are definitions
39
+ # for the sub-option. Similar to values for top-level options,
40
+ # properties can have a :description, :type, or any other key
41
+ # in this list.
42
+ #
43
+ # :additionalProperties A variation of the :properties key, where the hash is a
44
+ # Hash definition for any properties not specified in :properties.
45
+ # This can be used to permit arbitrary sub-options, such as
46
+ # logs for the 'log' option.
47
+ #
48
+ # :propertyNames Hash A hash that defines the properties that an option's property
49
+ # names must adhere to.
50
+ #
51
+ # :required Array An array of properties that are required for options that
52
+ # accept Hash values.
53
+ #
54
+ # :minimum Integer The minimum integer value for an option.
55
+ #
56
+ # :enum Array An array of values that the option recognizes.
57
+ #
58
+ # :pattern String A JSON regex pattern that the option's vaue should match.
59
+ #
60
+ # :format String Requires that a string value matches a format defined by the
61
+ # JSON Schema draft.
62
+ #
63
+ # :_plugin Boolean Whether the option accepts a plugin reference. This is used
64
+ # when generating the JSON schemas to determine whether or not
65
+ # to include a reference to the _plugin definition. If :_plugin
66
+ # is set to true, the script that generates JSON schemas will
67
+ # automatically recurse through the :items and :properties keys
68
+ # and add plugin references if applicable.
69
+ #
70
+ # :_example Any An example value for the option. This is used to generate
71
+ # reference documentation for configuration files.
72
+ #
73
+ # :_default Any The documented default value for the option. This is only
74
+ # used to generate reference documentation for configuration
75
+ # files and is not used by Bolt to actually set default values.
24
76
  TRANSPORT_OPTIONS = {
25
77
  "basic-auth-only" => {
26
78
  type: [TrueClass, FalseClass],
27
- desc: "Whether to force basic authentication. This option is only available when using SSL.",
28
- def: false,
29
- exmp: true
79
+ description: "Whether to force basic authentication. This option is only available when using SSL.",
80
+ _plugin: true,
81
+ _default: false,
82
+ _example: true
30
83
  },
31
84
  "cacert" => {
32
85
  type: String,
33
- desc: "The path to the CA certificate.",
34
- exmp: "~/.puppetlabs/puppet/cert.pem"
86
+ description: "The path to the CA certificate.",
87
+ _plugin: true,
88
+ _example: "~/.puppetlabs/puppet/cert.pem"
35
89
  },
36
90
  "cleanup" => {
37
91
  type: [TrueClass, FalseClass],
38
- desc: "Whether to clean up temporary files created on targets. When running commands on a target, "\
39
- "Bolt may create temporary files. After completing the command, these files are automatically "\
40
- "deleted. This value can be set to 'false' if you wish to leave these temporary files on the "\
41
- "target.",
42
- def: true,
43
- exmp: false
92
+ description: "Whether to clean up temporary files created on targets. When running commands on a target, "\
93
+ "Bolt may create temporary files. After completing the command, these files are "\
94
+ "automatically deleted. This value can be set to 'false' if you wish to leave these "\
95
+ "temporary files on the target.",
96
+ _plugin: true,
97
+ _default: true,
98
+ _example: false
44
99
  },
45
100
  "connect-timeout" => {
46
101
  type: Integer,
47
- desc: "How long to wait in seconds when establishing connections. Set this value higher if you "\
48
- "frequently encounter connection timeout errors when running Bolt.",
49
- def: 10,
50
- exmp: 15
102
+ description: "How long to wait in seconds when establishing connections. Set this value higher if you "\
103
+ "frequently encounter connection timeout errors when running Bolt.",
104
+ minimum: 1,
105
+ _plugin: true,
106
+ _default: 10,
107
+ _example: 15
51
108
  },
52
109
  "copy-command" => {
53
110
  type: [Array, String],
54
- desc: "The command to use when copying files using ssh-command. Bolt runs `<copy-command> <src> <dest>`. "\
55
- "This option is used when you need support for features or algorithms that are not supported "\
56
- "by the net-ssh Ruby library. **This option is experimental.** You can read more about this "\
57
- "option in [External SSH transport](experimental_features.md#external-ssh-transport).",
58
- def: "scp -r",
59
- exmp: "scp -r -F ~/ssh-config/myconf"
111
+ description: "The command to use when copying files using ssh-command. Bolt runs `<copy-command> <src> "\
112
+ "<dest>`. This option is used when you need support for features or algorithms that are not "\
113
+ "supported by the net-ssh Ruby library. **This option is experimental.** You can read more "\
114
+ "about this option in [External SSH "\
115
+ "transport](experimental_features.md#external-ssh-transport).",
116
+ items: {
117
+ type: String
118
+ },
119
+ _plugin: true,
120
+ _default: "scp -r",
121
+ _example: "scp -r -F ~/ssh-config/myconf"
60
122
  },
61
123
  "disconnect-timeout" => {
62
124
  type: Integer,
63
- desc: "How long to wait in seconds before force-closing a connection.",
64
- def: 5,
65
- exmp: 10
125
+ description: "How long to wait in seconds before force-closing a connection.",
126
+ minimum: 1,
127
+ _plugin: true,
128
+ _default: 5,
129
+ _example: 10
66
130
  },
67
131
  "encryption-algorithms" => {
68
132
  type: Array,
69
- desc: "A list of encryption algorithms to use when establishing a connection "\
70
- "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
71
- "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
72
- "non-deprecated algorithms are available by default when this option is not used. To "\
73
- "reference all default algorithms using this option, add 'defaults' to the list of "\
74
- "supported algorithms.",
75
- exmp: %w[defaults idea-cbc]
133
+ description: "A list of encryption algorithms to use when establishing a connection "\
134
+ "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
135
+ "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
136
+ "non-deprecated algorithms are available by default when this option is not used. To "\
137
+ "reference all default algorithms using this option, add 'defaults' to the list of "\
138
+ "supported algorithms.",
139
+ uniqueItems: true,
140
+ items: {
141
+ type: String
142
+ },
143
+ _plugin: true,
144
+ _example: %w[defaults idea-cbc]
76
145
  },
77
146
  "extensions" => {
78
147
  type: Array,
79
- desc: "A list of file extensions that are accepted for scripts or tasks on "\
80
- "Windows. Scripts with these file extensions rely on the target's file "\
81
- "type association to run. For example, if Python is installed on the "\
82
- "system, a `.py` script runs with `python.exe`. The extensions `.ps1`, "\
83
- "`.rb`, and `.pp` are always allowed and run via hard-coded "\
84
- "executables.",
85
- exmp: [".sh"]
148
+ description: "A list of file extensions that are accepted for scripts or tasks on "\
149
+ "Windows. Scripts with these file extensions rely on the target's file "\
150
+ "type association to run. For example, if Python is installed on the "\
151
+ "system, a `.py` script runs with `python.exe`. The extensions `.ps1`, "\
152
+ "`.rb`, and `.pp` are always allowed and run via hard-coded "\
153
+ "executables.",
154
+ uniqueItems: true,
155
+ items: {
156
+ type: String
157
+ },
158
+ _plugin: true,
159
+ _example: [".sh"]
86
160
  },
87
161
  "file-protocol" => {
88
162
  type: String,
89
- desc: "Which file transfer protocol to use. Either `winrm` or `smb`. Using `smb` is "\
90
- "recommended for large file transfers.",
91
- def: "winrm",
92
- exmp: "smb"
163
+ description: "Which file transfer protocol to use. Either `winrm` or `smb`. Using `smb` is "\
164
+ "recommended for large file transfers.",
165
+ enum: %w[smb winrm],
166
+ _plugin: true,
167
+ _default: "winrm",
168
+ _example: "smb"
93
169
  },
94
170
  "host" => {
95
171
  type: String,
96
- desc: "The target's hostname.",
97
- exmp: "docker_host_production"
172
+ description: "The target's hostname.",
173
+ _plugin: true,
174
+ _example: "docker_host_production"
98
175
  },
99
176
  "host-key-algorithms" => {
100
177
  type: Array,
101
- desc: "A list of host key algorithms to use when establishing a connection "\
102
- "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
103
- "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
104
- "non-deprecated algorithms are available by default when this option is not used. To "\
105
- "reference all default algorithms using this option, add 'defaults' to the list of "\
106
- "supported algorithms.",
107
- exmp: %w[defaults ssh-dss]
178
+ description: "A list of host key algorithms to use when establishing a connection "\
179
+ "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
180
+ "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
181
+ "non-deprecated algorithms are available by default when this option is not used. To "\
182
+ "reference all default algorithms using this option, add 'defaults' to the list of "\
183
+ "supported algorithms.",
184
+ uniqueItems: true,
185
+ items: {
186
+ type: String
187
+ },
188
+ _plugin: true,
189
+ _example: %w[defaults ssh-dss]
108
190
  },
109
191
  "host-key-check" => {
110
192
  type: [TrueClass, FalseClass],
111
- desc: "Whether to perform host key validation when connecting.",
112
- exmp: false
193
+ description: "Whether to perform host key validation when connecting.",
194
+ _plugin: true,
195
+ _example: false
113
196
  },
114
197
  "interpreters" => {
115
198
  type: Hash,
116
- desc: "A map of an extension name to the absolute path of an executable, enabling you to override "\
117
- "the shebang defined in a task executable. The extension can optionally be specified with the "\
118
- "`.` character (`.py` and `py` both map to a task executable `task.py`) and the extension is "\
119
- "case sensitive. When a target's name is `localhost`, Ruby tasks run with the Bolt Ruby "\
120
- "interpreter by default.",
121
- exmp: { "rb" => "/usr/bin/ruby" }
199
+ description: "A map of an extension name to the absolute path of an executable, enabling you to "\
200
+ "override the shebang defined in a task executable. The extension can optionally be "\
201
+ "specified with the `.` character (`.py` and `py` both map to a task executable "\
202
+ "`task.py`) and the extension is case sensitive. When a target's name is `localhost`, "\
203
+ "Ruby tasks run with the Bolt Ruby interpreter by default.",
204
+ additionalProperties: {
205
+ type: String
206
+ },
207
+ propertyNames: {
208
+ pattern: "^.?[a-zA-Z0-9]+$"
209
+ },
210
+ _plugin: true,
211
+ _example: { "rb" => "/usr/bin/ruby" }
122
212
  },
123
213
  "job-poll-interval" => {
124
214
  type: Integer,
125
- desc: "The interval, in seconds, to poll orchestrator for job status.",
126
- exmp: 2
215
+ description: "The interval, in seconds, to poll orchestrator for job status.",
216
+ minimum: 1,
217
+ _plugin: true,
218
+ _example: 2
127
219
  },
128
220
  "job-poll-timeout" => {
129
221
  type: Integer,
130
- desc: "The time, in seconds, to wait for orchestrator job status.",
131
- exmp: 2000
222
+ description: "The time, in seconds, to wait for orchestrator job status.",
223
+ minimum: 1,
224
+ _plugin: true,
225
+ _example: 2000
132
226
  },
133
227
  "kex-algorithms" => {
134
228
  type: Array,
135
- desc: "A list of key exchange algorithms to use when establishing a connection "\
136
- "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
137
- "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
138
- "non-deprecated algorithms are available by default when this option is not used. To "\
139
- "reference all default algorithms using this option, add 'defaults' to the list of "\
140
- "supported algorithms.",
141
- exmp: %w[defaults diffie-hellman-group1-sha1]
229
+ description: "A list of key exchange algorithms to use when establishing a connection "\
230
+ "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
231
+ "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
232
+ "non-deprecated algorithms are available by default when this option is not used. To "\
233
+ "reference all default algorithms using this option, add 'defaults' to the list of "\
234
+ "supported algorithms.",
235
+ uniqueItems: true,
236
+ items: {
237
+ type: String
238
+ },
239
+ _plugin: true,
240
+ _example: %w[defaults diffie-hellman-group1-sha1]
142
241
  },
143
242
  "load-config" => {
144
243
  type: [TrueClass, FalseClass],
145
- desc: "Whether to load system SSH configuration from '~/.ssh/config' and '/etc/ssh_config'.",
146
- def: true,
147
- exmp: false
244
+ description: "Whether to load system SSH configuration from '~/.ssh/config' and '/etc/ssh_config'.",
245
+ _plugin: true,
246
+ _default: true,
247
+ _example: false
148
248
  },
149
249
  "login-shell" => {
150
250
  type: String,
151
- desc: "Which login shell Bolt should expect on the target. Supported shells are " \
152
- "#{LOGIN_SHELLS.join(', ')}. **This option is experimental.**",
153
- def: "bash",
154
- exmp: "powershell"
251
+ description: "Which login shell Bolt should expect on the target. Supported shells are " \
252
+ "#{LOGIN_SHELLS.join(', ')}. **This option is experimental.**",
253
+ enum: LOGIN_SHELLS,
254
+ _plugin: true,
255
+ _default: "bash",
256
+ _example: "powershell"
155
257
  },
156
258
  "mac-algorithms" => {
157
259
  type: Array,
158
- desc: "List of message authentication code algorithms to use when establishing a connection "\
159
- "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
160
- "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
161
- "non-deprecated algorithms are available by default when this option is not used. To "\
162
- "reference all default algorithms using this option, add 'defaults' to the list of "\
163
- "supported algorithms.",
164
- exmp: %w[defaults hmac-md5]
260
+ description: "List of message authentication code algorithms to use when establishing a connection "\
261
+ "to a target. Supported algorithms are defined by the Ruby net-ssh library and can be "\
262
+ "viewed [here](https://github.com/net-ssh/net-ssh#supported-algorithms). All supported, "\
263
+ "non-deprecated algorithms are available by default when this option is not used. To "\
264
+ "reference all default algorithms using this option, add 'defaults' to the list of "\
265
+ "supported algorithms.",
266
+ uniqueItems: true,
267
+ items: {
268
+ type: String
269
+ },
270
+ _plugin: true,
271
+ _example: %w[defaults hmac-md5]
165
272
  },
166
273
  "password" => {
167
274
  type: String,
168
- desc: "The password to use to login.",
169
- exmp: "hunter2!"
275
+ description: "The password to use to login.",
276
+ _plugin: true,
277
+ _example: "hunter2!"
170
278
  },
171
279
  "port" => {
172
280
  type: Integer,
173
- desc: "The port to use when connecting to the target.",
174
- exmp: 22
281
+ description: "The port to use when connecting to the target.",
282
+ minimum: 0,
283
+ _plugin: true,
284
+ _example: 22
175
285
  },
176
286
  "private-key" => {
177
287
  type: [Hash, String],
178
- desc: "Either the path to the private key file to use for authentication, or "\
179
- "a hash with the key `key-data` and the contents of the private key.",
180
- exmp: "~/.ssh/id_rsa"
288
+ description: "Either the path to the private key file to use for authentication, or "\
289
+ "a hash with the key `key-data` and the contents of the private key.",
290
+ required: ["key-data"],
291
+ properties: {
292
+ "key-data" => {
293
+ description: "The contents of the private key.",
294
+ type: String
295
+ }
296
+ },
297
+ _plugin: true,
298
+ _example: "~/.ssh/id_rsa"
181
299
  },
182
300
  "proxyjump" => {
183
301
  type: String,
184
- desc: "A jump host to proxy connections through, and an optional user to connect with.",
185
- exmp: "jump.example.com"
302
+ description: "A jump host to proxy connections through, and an optional user to connect with.",
303
+ format: "uri",
304
+ _plugin: true,
305
+ _example: "jump.example.com"
186
306
  },
187
307
  "realm" => {
188
308
  type: String,
189
- desc: "The Kerberos realm (Active Directory domain) to authenticate against.",
190
- exmp: "BOLT.PRODUCTION"
309
+ description: "The Kerberos realm (Active Directory domain) to authenticate against.",
310
+ _plugin: true,
311
+ _example: "BOLT.PRODUCTION"
191
312
  },
192
313
  "run-as" => {
193
314
  type: String,
194
- desc: "The user to run commands as after login. The run-as user must be different than the login user.",
195
- exmp: "root"
315
+ description: "The user to run commands as after login. The run-as user must be different than the "\
316
+ "login user.",
317
+ _plugin: true,
318
+ _example: "root"
196
319
  },
197
320
  "run-as-command" => {
198
321
  type: Array,
199
- desc: "The command to elevate permissions. Bolt appends the user and command strings to the configured "\
200
- "`run-as-command` before running it on the target. This command must not require an interactive "\
201
- "password prompt, and the `sudo-password` option is ignored when `run-as-command` is specified. "\
202
- "The `run-as-command` must be specified as an array.",
203
- exmp: ["sudo", "-nkSEu"]
322
+ description: "The command to elevate permissions. Bolt appends the user and command strings to the "\
323
+ "configured `run-as-command` before running it on the target. This command must not require "\
324
+ " aninteractive password prompt, and the `sudo-password` option is ignored when "\
325
+ "`run-as-command` is specified. The `run-as-command` must be specified as an array.",
326
+ items: {
327
+ type: String
328
+ },
329
+ _plugin: true,
330
+ _example: ["sudo", "-nkSEu"]
204
331
  },
205
332
  "run-on" => {
206
333
  type: String,
207
- desc: "The proxy target that the task executes on.",
208
- def: "localhost",
209
- exmp: "proxy_target"
334
+ description: "The proxy target that the task executes on.",
335
+ format: "uri",
336
+ _plugin: true,
337
+ _default: "localhost",
338
+ _example: "proxy_target"
210
339
  },
211
340
  "script-dir" => {
212
341
  type: String,
213
- desc: "The subdirectory of the tmpdir to use in place of a randomized "\
214
- "subdirectory for uploading and executing temporary files on the "\
215
- "target. It's expected that this directory already exists as a subdir "\
216
- "of tmpdir, which is either configured or defaults to `/tmp`.",
217
- exmp: "bolt_scripts"
342
+ description: "The subdirectory of the tmpdir to use in place of a randomized "\
343
+ "subdirectory for uploading and executing temporary files on the "\
344
+ "target. It's expected that this directory already exists as a subdir "\
345
+ "of tmpdir, which is either configured or defaults to `/tmp`.",
346
+ _plugin: true,
347
+ _example: "bolt_scripts"
218
348
  },
219
349
  "service-url" => {
220
350
  type: String,
221
- desc: "The URL of the host used for API requests.",
222
- exmp: "https://api.example.com"
351
+ description: "The URL of the host used for API requests.",
352
+ format: "uri",
353
+ _plugin: true,
354
+ _example: "https://api.example.com"
223
355
  },
224
356
  "shell-command" => {
225
357
  type: String,
226
- desc: "A shell command to wrap any Docker exec commands in, such as `bash -lc`.",
227
- exmp: "bash -lc"
358
+ description: "A shell command to wrap any Docker exec commands in, such as `bash -lc`.",
359
+ _plugin: true,
360
+ _example: "bash -lc"
228
361
  },
229
362
  "smb-port" => {
230
363
  type: Integer,
231
- desc: "The port to use when connecting to the target when file-protocol is set to 'smb'.",
232
- exmp: 445
364
+ description: "The port to use when connecting to the target when file-protocol is set to 'smb'.",
365
+ minimum: 0,
366
+ _plugin: true,
367
+ _example: 445
233
368
  },
234
369
  "ssh-command" => {
235
370
  type: [Array, String],
236
- desc: "The command and flags to use when SSHing. This enables the external SSH transport, which "\
237
- "shells out to the specified command. This option is used when you need support for "\
238
- "features or algorithms that are not supported by the net-ssh Ruby library. **This option is "\
239
- "experimental.** You can read more about this option in [External SSH "\
240
- "transport](experimental_features.md#external-ssh-transport).",
241
- exmp: "ssh"
371
+ description: "The command and flags to use when SSHing. This enables the external SSH transport, which "\
372
+ "shells out to the specified command. This option is used when you need support for "\
373
+ "features or algorithms that are not supported by the net-ssh Ruby library. **This option "\
374
+ "is experimental.** You can read more about this option in [External SSH "\
375
+ "transport](experimental_features.md#external-ssh-transport).",
376
+ items: {
377
+ type: String
378
+ },
379
+ _plugin: true,
380
+ _example: "ssh"
242
381
  },
243
382
  "ssl" => {
244
383
  type: [TrueClass, FalseClass],
245
- desc: "Whether to use secure https connections for WinRM.",
246
- def: true,
247
- exmp: false
384
+ description: "Whether to use secure https connections for WinRM.",
385
+ _plugin: true,
386
+ _default: true,
387
+ _example: false
248
388
  },
249
389
  "ssl-verify" => {
250
390
  type: [TrueClass, FalseClass],
251
- desc: "Whether to verify that the target's certificate matches the cacert.",
252
- def: true,
253
- exmp: false
391
+ description: "Whether to verify that the target's certificate matches the cacert.",
392
+ _plugin: true,
393
+ _default: true,
394
+ _example: false
254
395
  },
255
396
  "sudo-executable" => {
256
397
  type: String,
257
- desc: "The executable to use when escalating to the configured `run-as` user. This is useful when you "\
258
- "want to escalate using the configured `sudo-password`, since `run-as-command` does not use "\
259
- "`sudo-password` or support prompting. The command executed on the target is `<sudo-executable> "\
260
- "-S -u <user> -p custom_bolt_prompt <command>`. **This option is experimental.**",
261
- exmp: "dzdo"
398
+ description: "The executable to use when escalating to the configured `run-as` user. This is useful "\
399
+ "when you want to escalate using the configured `sudo-password`, since `run-as-command` "\
400
+ "does not use `sudo-password` or support prompting. The command executed on the target "\
401
+ "is `<sudo-executable> -S -u <user> -p custom_bolt_prompt <command>`. **This option is "\
402
+ "experimental.**",
403
+ _plugin: true,
404
+ _example: "dzdo"
262
405
  },
263
406
  "sudo-password" => {
264
407
  type: String,
265
- desc: "The password to use when changing users via `run-as`.",
266
- exmp: "p@$$w0rd!"
408
+ description: "The password to use when changing users via `run-as`.",
409
+ _plugin: true,
410
+ _example: "p@$$w0rd!"
267
411
  },
268
412
  "task-environment" => {
269
413
  type: String,
270
- desc: "The environment the orchestrator loads task code from.",
271
- def: "production",
272
- exmp: "development"
414
+ description: "The environment the orchestrator loads task code from.",
415
+ _plugin: true,
416
+ _default: "production",
417
+ _example: "development"
273
418
  },
274
419
  "tmpdir" => {
275
420
  type: String,
276
- desc: "The directory to upload and execute temporary files on the target.",
277
- exmp: "/tmp/bolt"
421
+ description: "The directory to upload and execute temporary files on the target.",
422
+ _plugin: true,
423
+ _example: "/tmp/bolt"
278
424
  },
279
425
  "token-file" => {
280
426
  type: String,
281
- desc: "The path to the token file.",
282
- exmp: "~/.puppetlabs/puppet/token.pem"
427
+ description: "The path to the token file.",
428
+ _plugin: true,
429
+ _example: "~/.puppetlabs/puppet/token.pem"
283
430
  },
284
431
  "tty" => {
285
432
  type: [TrueClass, FalseClass],
286
- desc: "Whether to enable tty on exec commands.",
287
- exmp: true
433
+ description: "Whether to enable tty on exec commands.",
434
+ _plugin: true,
435
+ _example: true
288
436
  },
289
437
  "user" => {
290
438
  type: String,
291
- desc: "The user name to login as.",
292
- exmp: "bolt"
439
+ description: "The user name to login as.",
440
+ _plugin: true,
441
+ _example: "bolt"
293
442
  }
294
443
  }.freeze
295
444