Comment 8 for bug 1538812

Revision history for this message
Florian Haas (fghaas) wrote :

Just as a reference point. It appears that what this charm helper *really* wants to do is get the host's "default" IP address. Recognizing that a reverse name lookup is a rather poor way of finding that out, Ansible does an ip route get to two well-known IP addresses (v4 and v6) to determine the outgoing interface for the default route, and then returns that interface's address as ansible_default_ipv4.address, and ansible_default_ipv6.address.

See https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts.py#L1918 for details.