0

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 ?

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

here is the output of my task:

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
errata
  • 5,695
  • 10
  • 54
  • 99
user3802947
  • 63
  • 2
  • 7

1 Answers1

0

Try to add validate_certs: False to your task:

---
- hosts: localhost
  tasks:
       - name: Add ESXi Host to VCSA
         local_action:
           module: vmware_host
           hostname: xxxxxxxxxx
           username: administrator@vsphere.local
           password: xxxxx
           datacenter_name: Datacenter
           cluster_name: cluster1
           esxi_hostname: xxxxx
           esxi_username: root
           esxi_password: xxxx
           state: present
           validate_certs: False
errata
  • 5,695
  • 10
  • 54
  • 99
  • Oh yes actually i tried that as mentioned by otrher people in forums but looks like this parameter is no more supported. ansible-playbook sample.yml TASK [Add ESXi Host to VCSA] *************************************************** fatal: [localhost -> localhost]: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: validate_certs"} PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 – user3802947 May 14 '17 at 19:57
  • @user3802947 Ehhh :/ – errata May 14 '17 at 19:58