Ansible Role shell
This role executes arbitrary shell commands on the host.
Note that this role is not idempotent by default, consider setting creates
, removes
or run_once
(see below).
Optional Role Variables
Variable |
Description |
Default Value |
---|---|---|
|
List of dictionaries containing the commands to execute. Subkeys:
|
|
Example:
# optional
shell__commands__host_var:
- name: '100-setup-step2'
commands: |
touch test2
echo "test2 $(date)" >> /tmp/log
sleep 3
chdir: '/tmp'
creates: '/tmp/test2'
- name: '010-setup-step1'
commands: |
touch test1
echo "test1 $(date)" >> /tmp/log
sleep 3
run_once: true
chdir: '/tmp'
user: 'linuxfabrik'
ignore_errors: true