ANSIBLE: Adding VMware ESX server to Vcenter Failing though Ansible vmware_host module: Certificate Error



|

0down votefavorite


|


I am trying to add an ESX host to a vcenter server using Ansible code and vmware_host module. It’s failing in Certification validation. is there any workaround for this ?



<br>---<br>- hosts: localhost<br> tasks:<br> - name: Add ESXi Host to VCSA<br> local_action:<br> module: vmware_host<br> hostname: xxxxxxxxxx<br> username: administrator@vsphere.local<br> password: xxxxx<br> datacenter_name: Datacenter<br> cluster_name: cluster1<br> esxi_hostname: xxxxx<br> esxi_username: root<br> esxi_password: xxxx<br> state: present<br>



here is the output of my command run.'



xxxx@ubuntu:/etc/ansible$ sudo ansible-playbook sample.yml [WARNING]: provided hosts list is empty, only localhost is available



PLAY ***************************************************************************



TASK [setup] ******************************************************************* ok: [localhost]



TASK [Add ESXi Host to VCSA] *************************************************** fatal: [localhost → localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)”}



PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1




|

Rule number one, check the documentation
https://docs.ansible.com/ansible/vmware_host_module.html

I checked the document before posting. actuallly validate_certs parameter is no longer supported.

Thanks,
Vijay

What brought you to that conclusion?

I don’t see that indicated anywhere on that docs page. Using validate_certs is supported by the module.