Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed connection with proxmox without certs #9178

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- proxmox inventory plugin - fix connection without certificates
t-pierre marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion plugins/inventory/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _get_json(self, url, ignore_errors=None):
data = []
s = self._get_session()
while True:
ret = s.get(url, headers=self.headers)
ret = s.get(url, headers=self.headers, verify=s.verify)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which version of requests do you have that needs this? self._get_session() returns a requests.Session object with verify set, which according to the documentation (and the requests sources) should apply to all requests made with this session. So the change should not really have any effect. If it has an effect for you, I think we should first try to find out why that is the case.

Copy link
Author

@t-pierre t-pierre Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have requests 2.32.3 and python 3.12. I'm on mac, if it's important

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works on a lxc.

On macOS Sequoia 15.1.1: ❌

ansible --version

ansible [core 2.18.0]
  config file = /Users/*user*/Desktop/*project*/ansible.cfg
  configured module search path = ['/Users/*user*/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/11.0.0/libexec/lib/python3.13/site-packages/ansible
  ansible collection location = /Users/*user*/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.13.0 (main, Oct  7 2024, 05:02:14) [Clang 16.0.0 (clang-1600.0.26.4)] (/usr/local/Cellar/ansible/11.0.0/libexec/bin/python)
  jinja version = 3.1.4
  libyaml = True

On pipenv: ❌

ansible [core 2.18.0]
  config file = /Users/*user*/Desktop/*project*/ansible.cfg
  configured module search path = ['/Users/*user*/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/*user*/Desktop/*project*/lib/python3.12/site-packages/ansible
  ansible collection location = /Users/*user*/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/*user*/Desktop/*project*/bin/ansible
  python version = 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)] (/Users/*user*/Desktop/*project*/bin/python3.12)
  jinja version = 3.1.4
  libyaml = True

On a Debian GNU/Linux 11 (bullseye) lxc: ✅

ansible --version

ansible [core 2.15.12]
config file = /root/*project*/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /root/.local/lib/python3.9/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/usr/bin/python3)
jinja version = 3.1.4
libyaml = True

Tell me what information you need
Thanks!

if ignore_errors and ret.status_code in ignore_errors:
break
ret.raise_for_status()
Expand Down