Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement