Failed to connect to a Windows server using Ansible

Hello community.

I hope you are doing well.

I’m using Ansible to automate tasks from my windows servers, but it’s giving me an error like this. Does anyone know how I can fix it?

fatal: [xxxxxxx]: UNREACHABLE! => {
“changed”: false,
“msg”: “basic: HTTPSConnectionPool(host=‘xxxxxx’, port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)’)))”,
“unreachable”: true
}

Looks like it’s failing to verify the certificate to create a secure connection.

Assuming it’s a self signed cert you’ll need to ensure it’s trusted from your control host.

could always disable cert verification but wouldn’t recommend it.

Stu

I already did,

Even in the parameterization I indicate it to use HTTPS.

I attach an image of how I have ansible

ansible_user: “{{ansible_user}}”
ansible_password: “{{ansible_password}}”
ansible_connection: “winrm”
ansible_port: 5986
ansible_winrm_scheme: https
ansible_winrm_server_cert_validation: ignore
ansible_winrm_transport: ntlm
ansible_python_interpreter: /usr/bin/python3