1
0
mirror of https://github.com/rancher/os.git synced 2025-09-18 16:27:31 +00:00

Support string values for runcmd

This commit is contained in:
Josh Curl
2016-11-07 11:36:37 -08:00
parent ee16cd4311
commit c1abc67fa8
6 changed files with 65 additions and 14 deletions

View File

@@ -7,12 +7,13 @@ layout: os-default
## Running Commands
---
You can automate running commands on boot using the `runcmd` cloud-config directive. Commands must be specified in a list syntax as in the following example.
You can automate running commands on boot using the `runcmd` cloud-config directive. Commands can be specified as either a list or a string. In the latter case, the command is executed with `sh`.
```yaml
#cloud-config
runcmd:
- [ touch, /home/rancher/test ]
- [ touch, /home/rancher/test1 ]
- echo "test" > /home/rancher/test2
```
Commands specified using `runcmd` will be executed within the context of the `console` container. More details on the ordering of commands run in the `console` container can be found [here]({{site.baseurl}}/os/system-services/built-in-system-services/#console).