Last active
August 29, 2015 13:57
-
-
Save darkone23/9557442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> ansible-playbook -i test.ini test.yaml -kK SSH password: | |
sudo password [defaults to SSH password]: | |
PLAY [all] ******************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [shell whoami] ********************************************************** | |
changed: [localhost] | |
TASK: [debug msg={{whoami.stdout}}] ******************************************* | |
ok: [localhost] => { | |
"msg": "root" | |
} | |
PLAY RECAP ******************************************************************** | |
localhost : ok=3 changed=1 unreachable=0 failed=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[local] | |
localhost ansible_sudo_user=YOUR_USER_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
sudo: yes | |
tasks: | |
- shell: whoami | |
register: whoami | |
- debug: msg={{ whoami.stdout }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment