Hello, ansible experts.
I have a question regarding accessing ansible facts.
I have a system with interface named randomly and dynamically.
I successfully retrieved int name and registered it to variable.
Now, I want to know the IP address of it with ansible facts but how can I access it?
I tried to access “ansible_$interface” with following code,
`
-
name: retrieve interface
(snip)
register: interface -
debug: msg=“{{ ansible_$interface.stdout[‘ipv4’][‘address’]}}”
`
but all I got was simple characters.
ok: [node4] => { "msg": "{{ansible_$linked_bridge.stdout['ipv4']['address']}}" }
I know it’s a very fundamental question, but this variable problems always get in my way