User Tools

Site Tools


ansible_intro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ansible_intro [2017/01/31 10:33] luke7858ansible_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
 +</sxh>
 +^ Option ^ Description ^
 +| -s, --sudo | Force all plays to use sudo, even if not marked as such |
 +\\
 +\\
 === Running script locally === === Running script locally ===
-If you wish to run ansible playbooks from your local machine, you can define the following at the top of your playbook:+By default ansible will run against the hosts in the following file: /etc/ansible/hosts 
 +\\ 
 +\\ 
 +If you wish to install and then run ansible playbooks on your local machine/directly on the server-in-question, you can define the following at the top of your playbook:
 <sxh bash> <sxh bash>
 --- ---
Line 6: Line 18:
 connection: local connection: local
 </sxh> </sxh>
 +\\
 You can also run ansible commands locally with the following command: You can also run ansible commands locally with the following command:
 <sxh bash># ansible localhost -a "/bin/echo hello" <sxh bash># ansible localhost -a "/bin/echo hello"
ansible_intro.1485858827.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki