Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. root@noc-01:/etc/ansible# cat test.yml
  2. ---
  3. - hosts: all
  4. tasks:
  5. - name: Incl. var file
  6. include_vars: var.yml
  7.  
  8. - name: Echo
  9. debug:
  10. msg: Ello '{{ test }}'
  11. root@noc-01:/etc/ansible# cat var.yml
  12. test: "{{ hostvars['10.0.0.1']['ansible_hostname'] }}"
  13.  
  14.  
  15. RESULT:
  16.  
  17. TASK [Echo] ********************************************************************
  18. ok: [10.0.0.1] => {
  19. "msg": "Ello 'test'"
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement