diff --git a/changelogs/fragments/5915-suppress-urllib3-insecure-request-warnings.yml b/changelogs/fragments/5915-suppress-urllib3-insecure-request-warnings.yml new file mode 100644 index 0000000000..9fa285154a --- /dev/null +++ b/changelogs/fragments/5915-suppress-urllib3-insecure-request-warnings.yml @@ -0,0 +1,2 @@ +minor_changes: + - proxmox - suppress urllib3 ``InsecureRequestWarnings`` when ``validate_certs`` option is ``false`` (https://github.com/ansible-collections/community.general/pull/5931). diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py index e33f7ed77d..dc2e1febca 100644 --- a/plugins/inventory/proxmox.py +++ b/plugins/inventory/proxmox.py @@ -277,6 +277,11 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): credentials = urlencode({'username': self.proxmox_user, 'password': self.proxmox_password, }) a = self._get_session() + + if a.verify is False: + from requests.packages.urllib3 import disable_warnings + disable_warnings() + ret = a.post('%s/api2/json/access/ticket' % self.proxmox_url, data=credentials) json = ret.json()