2018-08-02 11:46:44 +02:00
|
|
|
# 1 - Run Playbook
|
2018-07-30 13:42:10 +02:00
|
|
|
|
|
|
|
This exercise introduces you to running playbook. The playbook is already written.
|
|
|
|
|
|
|
|
## Visualize the playbook
|
|
|
|
|
|
|
|
The playbook is named `ping.yml`. Open it with your favorite editor.
|
|
|
|
|
|
|
|
## Run the playbook
|
|
|
|
|
|
|
|
Run the playbook with the inventory file adapted to your lab setup:
|
|
|
|
```bash
|
|
|
|
ansible-playbook -i ../hosts ping.yml
|
|
|
|
```
|
|
|
|
|
|
|
|
## Pass args on the command line
|
|
|
|
|
|
|
|
Now change the value of the `ping` output with overwriting the `ping_output` vars.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
ansible-playbook -v -i ../hosts ping.yml -e "ping_output=Ansible is great"
|
|
|
|
```
|
|
|
|
|