mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
set -e - again
This commit is contained in:
parent
68eae69fb5
commit
ceac9628c2
@ -104,9 +104,9 @@ This example-playbook would execute (on all hosts defined in the inventory) two
|
|||||||
* `shell` that execute three commands and return the output to our terminal
|
* `shell` that execute three commands and return the output to our terminal
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
hosts: all
|
- hosts: all
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: "ping all"
|
- name: "ping all"
|
||||||
ping:
|
ping:
|
||||||
|
|
||||||
@ -152,19 +152,19 @@ Role can be included in your playbook (executed via your playbook).
|
|||||||
|
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
hosts: all
|
- hosts: all
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: "ping all"
|
- name: "ping all"
|
||||||
ping:
|
ping:
|
||||||
- name: "execute a shell command"
|
- name: "execute a shell command"
|
||||||
shell: "date; whoami; df -h;"
|
shell: "date; whoami; df -h;"
|
||||||
|
|
||||||
role:
|
roles:
|
||||||
- some_role
|
- some_role
|
||||||
- { role: another_role, some_variable: 'learnxiny', tags: ['my_tag'] }
|
- { role: another_role, some_variable: 'learnxiny', tags: ['my_tag'] }
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: some pre-task
|
- name: some pre-task
|
||||||
shell: echo 'this task is the last, but would be executed before roles, and before tasks'
|
shell: echo 'this task is the last, but would be executed before roles, and before tasks'
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user