Advertisement
Guest User

Untitled

a guest
Mar 16th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. [09:50] myuser@machine:~/$ cat test.yml
  2. ---
  3. - hosts: localhost
  4. gather_facts: true
  5. become: true
  6. tasks:
  7. - set_fact:
  8. my_user: myuser
  9. - debug: msg="{{ lookup('pipe', 'id -u ' + my_user) }}"
  10. [09:50] myuser@machine:~/$ ansible-playbook test.yml
  11. SUDO password:
  12.  
  13. PLAY ***************************************************************************
  14.  
  15. TASK [setup] *******************************************************************
  16. ok: [localhost]
  17.  
  18. TASK [set_fact] ****************************************************************
  19. ok: [localhost]
  20.  
  21. TASK [debug] *******************************************************************
  22. ok: [localhost] => {
  23. "msg": "5670"
  24. }
  25.  
  26. PLAY RECAP *********************************************************************
  27. localhost : ok=3 changed=0 unreachable=0 failed=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement