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

community.vmware.vsphere_copy ignore validate_certs: no #2274

Open
BeoKool opened this issue Dec 18, 2024 · 2 comments
Open

community.vmware.vsphere_copy ignore validate_certs: no #2274

BeoKool opened this issue Dec 18, 2024 · 2 comments

Comments

@BeoKool
Copy link

BeoKool commented Dec 18, 2024

SUMMARY

When using the "community.vmware.vsphere_copy" module, for upload file from local to vsphere I use validate_certs: no in my playbook, I use flag -vvv for debug and here the log

module_stderr: 
Traceback (most recent call last):
  File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1077, in _send_output
    self.send(chunk)
  File "/usr/lib/python3.10/http/client.py", line 999, in send
    self.sock.sendall(data)
  File "/usr/lib/python3.10/ssl.py", line 1270, in sendall
    v = self.send(byte_view[count:])
  File "/usr/lib/python3.10/ssl.py", line 1239, in send
    return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2426)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/ansible_community.vmware.vsphere_copy_payload_40yubxhu/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/community/vmware/plugins/modules/vsphere_copy.py", line 199, in main
  File "/tmp/ansible_community.vmware.vsphere_copy_payload_40yubxhu/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py", line 995, in open_url
  File "/tmp/ansible_community.vmware.vsphere_copy_payload_40yubxhu/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py", line 899, in open
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol + 
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req)
  File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:2426)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gitlab-runner/.ansible/tmp/ansible-tmp-1733929922.2209332-472553-163651881801185/AnsiballZ_vsphere_copy.py", line 107, in <module>
    _ansiballz_main()
  File "/home/gitlab-runner/.ansible/tmp/ansible-tmp-1733929922.2209332-472553-163651881801185/AnsiballZ_vsphere_copy.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/gitlab-runner/.ansible/tmp/ansible-tmp-1733929922.2209332-472553-163651881801185/AnsiballZ_vsphere_copy.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vsphere_copy', 
                     init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vsphere_copy', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals)
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_community.vmware.vsphere_copy_payload_40yubxhu/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/community/vmware/plugins/modules/vsphere_copy.py", line 241, in <module>
  File "/tmp/ansible_community.vmware.vsphere_copy_payload_40yubxhu/ansible_community.vmware.vsphere_copy_payload.zip/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/community/vmware/plugins/modules/vsphere_copy.py", line 206, in main
TypeError: 'URLError' object is not subscriptable

ISSUE TYPE

Bug Report
COMPONENT NAME
community.vmware.vsphere_copy

ANSIBLE VERSION

ansible [core 2.16.3]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.16 (main, Dec  4 2024, 08:53:38) [GCC 13.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = False
@ihumster
Copy link
Collaborator

I looked at the code and don't see where there could be an error. What version of collection you use? And don't use yes | no in your playbooks - replace them on true | false

@BeoKool
Copy link
Author

BeoKool commented Dec 19, 2024

collection version is: community.vmware 4.8.1

I use false in my playbooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants