Advertisement
sandervanvugt

Untitled

Jun 9th, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. ---
  2. - hosts: all
  3. tasks:
  4. - name: show IP address
  5. debug:
  6. msg: >
  7. This host uses IP address {{ ansible_facts.default_ipv4.address }}
  8. - name: show IP address injected variables style
  9. debug:
  10. msg: THe IP address is {{ ansible_default_ipv4.address }}
  11. - name: show IP address preferred style
  12. debug:
  13. msg: The IP address is {{ ansible_facts['default_ipv4']['address'] }}
  14. - name: show IP addresses old way
  15. debug:
  16. msg: IP is {{ ansible_default_ipv4['address'] }}
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement