UpCloudLtd/upcloud-ansible

Better handling of IPv6 addresses

elnygren opened this issue · 2 comments

Currently the upcloud module that is used to create/destroy servers populates an attribute called public_ip that prefers IPv4 due to UpCloudLtd/upcloud-python-api#13. A better option would be to populate public_ipv4 and public_ipv6 attributes.

In addition, the same problem is inherent in the inventory script. Perhaps the .ini file could be used to control whether to use IPv4 or IPv6 (or which would be preferred as both are not guaranteed to exist).

support added for this added in upcloud_api

https://github.com/UpCloudLtd/upcloud-python-api/blob/0.3.4-devel/upcloud_api/server.py#L377

implementation could be something along the lines of:

public_ipv4 = server.get_public_ip(addr_family='IPv4', strict=True)
public_ipv6 = server.get_public_ip(addr_family='IPv6', strict=True)

Hello. We have fixed this issue in #33 Thank you for posting the issue.