diff --git a/changelogs/fragments/inventory-ipv6-adress-variable.yml b/changelogs/fragments/inventory-ipv6-adress-variable.yml new file mode 100644 index 0000000..baa7e30 --- /dev/null +++ b/changelogs/fragments/inventory-ipv6-adress-variable.yml @@ -0,0 +1,2 @@ +minor_changes: + - inventory plugin - Add public IPv6 address to server variables. diff --git a/plugins/inventory/hcloud.py b/plugins/inventory/hcloud.py index 303dd0a..f032eb8 100644 --- a/plugins/inventory/hcloud.py +++ b/plugins/inventory/hcloud.py @@ -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,