ansible_intro
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ansible_intro [2017/01/31 09:23] – created luke7858 | ansible_intro [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===Running ansible playbook=== | ||
| + | To run an ansible playbook you can run the following command: | ||
| + | <sxh bash> | ||
| + | # ansible-playbook -s playbook.yml | ||
| + | </ | ||
| + | ^ Option ^ Description ^ | ||
| + | | -s, --sudo | Force all plays to use sudo, even if not marked as such | | ||
| + | \\ | ||
| + | \\ | ||
| + | === Running script locally === | ||
| + | By default ansible will run against the hosts in the following file: / | ||
| + | \\ | ||
| + | \\ | ||
| + | If you wish to install and then run ansible playbooks on your local machine/ | ||
| + | <sxh bash> | ||
| + | --- | ||
| + | - hosts: 127.0.0.1 | ||
| + | connection: local | ||
| + | </ | ||
| + | \\ | ||
| + | You can also run ansible commands locally with the following command: | ||
| <sxh bash># ansible localhost -a "/ | <sxh bash># ansible localhost -a "/ | ||
| localhost | success | rc=0 >> | localhost | success | rc=0 >> | ||
| hello | hello | ||
| </ | </ | ||
ansible_intro.1485854622.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
