1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Added private_ipv4 to the hostvars in Scaleway dynamic inventory (#44122)

This commit is contained in:
Rémy Léone 2018-08-28 22:35:38 +02:00 committed by ansibot
parent ea0f722d74
commit 70adbb87d9

View file

@ -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, "public_ipv4", extract_public_ipv4(server_info=server_info))
self.inventory.set_variable(host, "ansible_host", 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): def _get_zones(self, config_zones):
return set(SCALEWAY_LOCATION.keys()).intersection(config_zones) return set(SCALEWAY_LOCATION.keys()).intersection(config_zones)