Advertisement
sandervanvugt

Untitled

Aug 25th, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 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 old notation
  9. debug:
  10. msg: >
  11. This host uses IP address {{ ansible_default_ipv4.address }}
  12. - name: show IP address the fancy way
  13. debug:
  14. msg: >
  15. This host uses IP address {{ ansible_facts['default_ipv4']['address'] }}
  16. - name: fancy old way
  17. debug:
  18. msg: >
  19. This host uses IP address {{ ansible_default_ipv4['address'] }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement