SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify

Hi Ansible team,

We are facing the certificate verification issue while executing ansible-playbook.
Could you please suggest how to resolve this issue?

ERROR Logs:

Ansible team,

Is there a workaround solution for this issue?

Thanks,
Jagannath

Your error is clearly about HTTPS certificate verification. If that
fails, disable it.
You haven't shared any playbook code, so we don't know what task
generated this error, so we can't tell more.

Hi,

Thanks for the reply. This error occurs even for gather_facts command.

ansible all -m gather_facts --tree /tmp/facts
[WARNING]: * Failed to parse /home/ejagpat/mps/SOURCE_TTCN/mec_admin/script/ansibleSource/k8s.yml with k8s plugin:
HTTPSConnectionPool(host=‘XXXX.XXX.XXX.XX’, port=443): Max retries exceeded with url: /k8s/clusters/c-nmgnf/version (Caused by SSLError(SSLError(1,
u’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),))
[WARNING]: Unable to parse /home/ejagpat/mps/SOURCE_TTCN/mec_admin/script/ansibleSource/k8s.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’

Disabling certificate check also didnot work.
Please suggest other methods, i give a try.

Thanks,
Jagannath

Hi,

are you sure you disabled HTTPS certificate checks for the k8s
inventory plugin? In your original posting, you disabled SSH host key
checking.

Please check out
https://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_inventory.html#parameter-connections/validate_certs

Cheers,
Felix

Hi Felix,

Thanks for this info. I did not aware of this K8S inventory plugin option.
Now the ansible is working for us.

Thank again, very much appreciated your help.

Cheers,
Jagannath