1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

feat(inventory): add variable for ipv6 address (#188)

This variable matches the `ansible_host` variable that we set when
`connect_with: public_ipv6`, and allows the user to dynamically choose the
connection method in `compose`.
This commit is contained in:
Julian Tölle 2023-02-01 12:56:21 +01:00 committed by GitHub
parent bfe0f7a575
commit 1863fe512c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- inventory plugin - Add public IPv6 address to server variables.

View file

@ -225,6 +225,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
if server.public_net.ipv6:
self.inventory.set_variable(server.name, "ipv6_network", to_native(server.public_net.ipv6.network))
self.inventory.set_variable(server.name, "ipv6_network_mask", to_native(server.public_net.ipv6.network_mask))
self.inventory.set_variable(server.name, "ipv6", to_native(self._first_ipv6_address(server.public_net.ipv6.ip)))
self.inventory.set_variable(
server.name,