I would like to determine the interface ipv6 address of the host, where ansible connects from and use it as variable in my playbook. I know how to get the ipv6 address from the facts:
{{ ansible_facts['ens192']['ipv6'][0]['address'] }}
My only problem is that the interface might be something else but ens192, because I have hosts with multiple interfaces. I always need that interface's address where ansible connect to host, which might be ensX
If you could provide me a solution for IPv4, it is good enough for me. :) Please note that default_ipv4_address does not work for me, because the default interface is not always where the ansible connection is coming.
UPDATE:
I think it will be good if I could get the IPv6 address where ansible connects to and get it's variable somehow. So if ansible connects to host1.something.local and it has an IPv6 address: 2001:1:2:3::4 get that IPv6 address as variable and use it in playbook.