2017-01-27 09:39:22 +00:00
|
|
|
# ansible-playbook
|
|
|
|
|
|
|
|
> Execute tasks defined in playbook on remote machines over SSH.
|
2019-01-30 11:19:23 +00:00
|
|
|
> Homepage: <https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html>.
|
2017-01-27 09:39:22 +00:00
|
|
|
|
|
|
|
- Run tasks in playbook:
|
|
|
|
|
|
|
|
`ansible-playbook {{playbook}}`
|
|
|
|
|
|
|
|
- Run tasks in playbook with custom host inventory:
|
|
|
|
|
|
|
|
`ansible-playbook {{playbook}} -i {{inventory_file}}`
|
2017-10-26 21:07:08 +01:00
|
|
|
|
|
|
|
- Run tasks in playbook with extra variables defined via the command line:
|
|
|
|
|
|
|
|
`ansible-playbook {{playbook}} -e "{{variable1}}={{value1}} {{variable2}}={{value2}}"`
|
|
|
|
|
2017-10-26 21:29:17 +01:00
|
|
|
- Run tasks in playbook with extra variables defined in a json file:
|
2017-10-26 21:07:08 +01:00
|
|
|
|
|
|
|
`ansible-playbook {{playbook}} -e "@{{variables.json}}"`
|