From 70adbb87d90654a2f732f75e6f2912534c28e0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 28 Aug 2018 22:35:38 +0200 Subject: [PATCH] Added private_ipv4 to the hostvars in Scaleway dynamic inventory (#44122) --- lib/ansible/plugins/inventory/scaleway.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/plugins/inventory/scaleway.py b/lib/ansible/plugins/inventory/scaleway.py index 69de0d289e3..a7e4baa83a3 100644 --- a/lib/ansible/plugins/inventory/scaleway.py +++ b/lib/ansible/plugins/inventory/scaleway.py @@ -177,6 +177,9 @@ class InventoryModule(BaseInventoryPlugin): self.inventory.set_variable(host, "public_ipv4", extract_public_ipv4(server_info=server_info)) self.inventory.set_variable(host, "ansible_host", extract_public_ipv4(server_info=server_info)) + if extract_private_ipv4(server_info=server_info): + self.inventory.set_variable(host, "private_ipv4", extract_private_ipv4(server_info=server_info)) + def _get_zones(self, config_zones): return set(SCALEWAY_LOCATION.keys()).intersection(config_zones)