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:
@@ -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).
|
||||
|
Reference in New Issue
Block a user