Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@noc-01:/etc/ansible# cat test.yml
- ---
- - hosts: all
- tasks:
- - name: Incl. var file
- include_vars: var.yml
- - name: Echo
- debug:
- msg: Ello '{{ test }}'
- root@noc-01:/etc/ansible# cat var.yml
- test: "{{ hostvars['10.0.0.1']['ansible_hostname'] }}"
- RESULT:
- TASK [Echo] ********************************************************************
- ok: [10.0.0.1] => {
- "msg": "Ello 'test'"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement