Created
March 16, 2016 08:51
-
-
Save hyperized/de9f5498af9d967bf360 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
[09:50] myuser@machine:~/$ cat test.yml | |
--- | |
- hosts: localhost | |
gather_facts: true | |
become: true | |
tasks: | |
- set_fact: | |
my_user: myuser | |
- debug: msg="{{ lookup('pipe', 'id -u ' + my_user) }}" | |
[09:50] myuser@machine:~/$ ansible-playbook test.yml | |
SUDO password: | |
PLAY *************************************************************************** | |
TASK [setup] ******************************************************************* | |
ok: [localhost] | |
TASK [set_fact] **************************************************************** | |
ok: [localhost] | |
TASK [debug] ******************************************************************* | |
ok: [localhost] => { | |
"msg": "5670" | |
} | |
PLAY RECAP ********************************************************************* | |
localhost : ok=3 changed=0 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment