Categories

Dec 1, 2019 in DevOps

Q: How to access variable names in Ansible?

1 Answer

Dec 1, 2019

Using hostvars method we can access and add the variables like below

{{ hostvars[inventory_hostname][‘ansible_’ + which_interface][‘ipv4’][‘address’] }}

Click here to read more about DevOps
Click here to read more about Insurance

Related questions

Madanswer
Nov 13, 2019 in Ansible
Oct 4 in Web Hosting
Oct 3 in Web Hosting
...