From 9a8bf0e38ac01ccc07f9ead8e318da8066479b02 Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Wed, 22 Mar 2023 04:56:36 +0100 Subject: [PATCH] fix(contrib/terraform): do not add access_ip when not wanted (#9869) --- contrib/terraform/terraform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/terraform/terraform.py b/contrib/terraform/terraform.py index 0c9c287b4..f67b9d82d 100755 --- a/contrib/terraform/terraform.py +++ b/contrib/terraform/terraform.py @@ -298,6 +298,9 @@ def openstack_host(resource, module_name): if 'floating_ip' in raw_attrs: attrs['private_ipv4'] = raw_attrs['network.0.fixed_ip_v4'] + if 'metadata.use_access_ip' in raw_attrs and raw_attrs['metadata.use_access_ip'] == "0": + attrs.pop('access_ip') + try: if 'metadata.prefer_ipv6' in raw_attrs and raw_attrs['metadata.prefer_ipv6'] == "1": attrs.update({