From 62c0169e64f2c3594430d587b66448627caa00ff Mon Sep 17 00:00:00 2001 From: Jakob Meng Date: Mon, 6 Mar 2023 21:07:23 +0100 Subject: [PATCH] Fixed private option in inventory plugin Story: 2010614 Task: 47538 Change-Id: I64e1b3ce5323ca8e351ee9faef4bddbef53dfd5d --- plugins/inventory/openstack.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/inventory/openstack.py b/plugins/inventory/openstack.py index 780ac29c..db6b78a7 100644 --- a/plugins/inventory/openstack.py +++ b/plugins/inventory/openstack.py @@ -293,10 +293,6 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): clouds = [openstack.connection.Connection(config=cloud_region) for cloud_region in cloud_regions] - if self.get_option('private'): - for cloud in self.clouds: - cloud.private = True - self.display.vvvv( 'Found {0} OpenStack cloud(s)' .format(len(clouds))) @@ -393,7 +389,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): if address['OS-EXT-IPS:type'] == 'fixed'), None) - ip = floating_ip if floating_ip is not None else fixed_ip + ip = floating_ip if floating_ip is not None and not self.get_option('private') else fixed_ip if ip is not None: host_vars['ansible_ssh_host'] = ip