Skip to content

Instantly share code, notes, and snippets.

@lae
Created October 25, 2018 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lae/ded5e1aa3faf0f9bf0d4ba9ba52ae476 to your computer and use it in GitHub Desktop.
Save lae/ded5e1aa3faf0f9bf0d4ba9ba52ae476 to your computer and use it in GitHub Desktop.
---
- hosts: localhost
connection: local
tasks:
- debug:
var: ansible_ssh_user
- debug:
message: "{{ item }}"
with_items:
- "{{ ansible_ssh_user }}"
[lae@yuzu hack]$ ansible-playbook -i localhost, local_module_test.yml -K
SUDO password:
PLAY [localhost] **********************************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [debug] **************************************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
"ansible_ssh_user": "lae"
}
TASK [debug] **************************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "'ansible_ssh_user' is undefined"}
to retry, use: --limit @/home/lae/hack/local_module_test.retry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment