Closed elnygren closed 3 years ago
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 https://github.com/UpCloudLtd/upcloud-ansible/pull/33 Thank you for posting the issue.
Currently the
upcloud
module that is used to create/destroy servers populates an attribute calledpublic_ip
that prefers IPv4 due to https://github.com/UpCloudLtd/upcloud-python-api/issues/13. A better option would be to populatepublic_ipv4
andpublic_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).