You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pre-docs/bolt_configuration_options.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,15 @@ ssh:
92
92
93
93
`service-options`: A hash of options to configure the Docker connection. Only necessary if using a non-default URL. See https://github.com/swipely/docker-api for supported options.
94
94
95
+
## Remote transport configuration options
96
+
97
+
*The remote transport is a new feature and currently experimental. It's configuration options and behavior may change between y releases*
98
+
99
+
`run-on`: The proxy target the task should execute on. Default is `localhost`
100
+
101
+
`conn-info`: A hash of connection info that will be passed to the device as `_target`.
102
+
103
+
95
104
## Log file configuration options
96
105
97
106
Capture the results of your plan runs in a log file.
Copy file name to clipboardExpand all lines: pre-docs/writing_tasks.md
+33-21Lines changed: 33 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Pattern[/\A[^\/\\]*\z/] $path
80
80
81
81
In addition to these task restrictions, different scripting languages each have their own ways to validate user input.
82
82
83
-
### PowerShell
83
+
### PowerShell
84
84
85
85
In PowerShell, code injection exploits calls that specifically evaluate code. Do not call `Invoke-Expression` or `Add-Type` with user input. These commands evaluate strings as C\# code.
86
86
@@ -129,7 +129,7 @@ Resolve file paths with `os.realpath` and confirm them to be within another path
129
129
130
130
For more information on the vulnerabilities of Python or how to escape variables, see Kevin London's blog post on [Dangerous Python Functions](https://www.kevinlondon.com/2015/07/26/dangerous-python-functions.html).
131
131
132
-
### Ruby
132
+
### Ruby
133
133
134
134
In Ruby, command injection is introduced through commands like `eval`, `exec`, `system`, backtick \(\`\`\) or `%x()` execution, or the Open3 module. You can safely call these functions with user input by passing the input as additional arguments instead of a single string.
135
135
@@ -296,7 +296,7 @@ To create a task that includes additional files pulled from modules, include the
296
296
297
297
- the module name
298
298
- one of `lib`, `files`, or `tasks` for the directory within the module
299
-
- the remaining path to a file or directory; directories must include a trailing slash `/`
299
+
- the remaining path to a file or directory; directories must include a trailing slash `/`
300
300
301
301
All path separators must be forward slashes. An example would be `stdlib/lib/puppet/`.
302
302
@@ -317,15 +317,15 @@ When a task includes the `files` property, all files listed in the top-level p
317
317
318
318
For example, you can create a task and metadata in a new module at `~/.puppetlabs/bolt/site/mymodule/tasks/task.{json,rb}`.
To simplify writing tasks, Bolt includes [python\_task\_helper](https://github.com/puppetlabs/puppetlabs-python_task_helper) and [ruby\_task\_helper](https://github.com/puppetlabs/puppetlabs-ruby_task_helper). It also makes a useful demonstration of including code from another module.
@@ -369,7 +381,7 @@ To simplify writing tasks, Bolt includes [python\_task\_helper](https://github.c
369
381
370
382
Create task and metadata in a module at `~/.puppetlabs/bolt/site/mymodule/tasks/task.{json,py}`.
371
383
372
-
**Metadata**
384
+
**Metadata**
373
385
374
386
```
375
387
{
@@ -378,7 +390,7 @@ Create task and metadata in a module at `~/.puppetlabs/bolt/site/mymodule/tasks/
378
390
}
379
391
```
380
392
381
-
**Task**
393
+
**Task**
382
394
383
395
```
384
396
#!/usr/bin/env python
@@ -395,7 +407,7 @@ if __name__ == '__main__':
395
407
MyTask().run()
396
408
```
397
409
398
-
**Output**
410
+
**Output**
399
411
400
412
```
401
413
$ bolt task run mymodule::task -n localhost name='Julia'
@@ -412,7 +424,7 @@ Ran on 1 node in 0.12 seconds
412
424
413
425
Create task and metadata in a new module at `~/.puppetlabs/bolt/site/mymodule/tasks/mytask.{json,rb}`.
414
426
415
-
**Metadata**
427
+
**Metadata**
416
428
417
429
```
418
430
{
@@ -421,7 +433,7 @@ Create task and metadata in a new module at `~/.puppetlabs/bolt/site/mymodule/ta
$ bolt task run mymodule::mytask -n localhost name="Robert'); DROP TABLE Students;--"
@@ -469,7 +481,7 @@ For example, to add a `message` parameter to your task, read it from the environ
469
481
echo your message is $PT_message
470
482
```
471
483
472
-
### Defining parameters in Windows
484
+
### Defining parameters in Windows
473
485
474
486
For Windows tasks, you can pass parameters as environment variables, but it's easier to write your task in PowerShell and use named arguments. By default tasks with a `.ps1` extension use PowerShell standard argument handling.
475
487
@@ -805,16 +817,16 @@ To define a parameter as sensitive within the JSON metadata, add the `"sensitive
805
817
806
818
The following table shows task metadata keys, values, and default values.
807
819
808
-
#### **Task metadata**
820
+
#### **Task metadata**
809
821
810
822
|Metadata key|Description|Value|Default|
811
823
|------------|-----------|-----|-------|
812
824
|"description"|A description of what the task does.|String|None|
813
-
|"input\_method"|What input method the task runner should use to pass parameters to the task.| - `environment`
825
+
|"input\_method"|What input method the task runner should use to pass parameters to the task.| - `environment`
814
826
815
-
-`stdin`
827
+
-`stdin`
816
828
817
-
-`powershell`
829
+
-`powershell`
818
830
819
831
820
832
| Both `environment` and `stdin` unless `.ps1` tasks, in which case `powershell`
@@ -833,7 +845,7 @@ Task metadata can accept most Puppet data types.
833
845
834
846
#### Common task data types
835
847
836
-
**Restriction:**
848
+
**Restriction:**
837
849
838
850
Some types supported by Puppet can not be represented as JSON, such as `Hash[Integer, String]`, `Object`, or `Resource`. These should not be used in tasks, because they can never be matched.
839
851
@@ -850,7 +862,7 @@ Some types supported by Puppet can not be represented as JSON, such as `Hash[Int
850
862
|`Variant[Integer, Pattern[/\A\d+\Z/]]`|Matches an integer or a String of an integer|
851
863
|`Boolean`|Accepts Boolean values.|
852
864
853
-
**Related information**
865
+
**Related information**
854
866
855
867
856
868
[Data type syntax](https://puppet.com/docs/puppet/latest/lang_data_type.html)
0 commit comments