diff --git a/plugins/inventory/vmware_vm_inventory.py b/plugins/inventory/vmware_vm_inventory.py index d26b8984c..4b07d2a75 100644 --- a/plugins/inventory/vmware_vm_inventory.py +++ b/plugins/inventory/vmware_vm_inventory.py @@ -494,6 +494,13 @@ def _login_vapi(self): # Disable warning shown at stdout requests.packages.urllib3.disable_warnings() + if self.proxy_host and self.proxy_port: + proxies = { + 'http': f'http://{self.proxy_host}:{self.proxy_port}', + 'https': f'http://{self.proxy_host}:{self.proxy_port}', + } + session.proxies.update(proxies) + server = self.hostname if self.port: server += ":" + str(self.port)