Skip to content

Instantly share code, notes, and snippets.

@darkone23
Last active August 29, 2015 13:57
Show Gist options
  • Save darkone23/9557442 to your computer and use it in GitHub Desktop.
Save darkone23/9557442 to your computer and use it in GitHub Desktop.
-> 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
[local]
localhost ansible_sudo_user=YOUR_USER_NAME
- 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