0

我正在尝试使用 Ansible 代码和 vmware_host 模块将 ESX 主机添加到 vCenter 服务器。它在认证验证中失败。有什么解决方法吗?

---
- 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

这是我的任务的输出:

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
4

1 回答 1

0

尝试添加validate_certs: False到您的任务中:

---
- 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
于 2017-05-14T18:50:13.127 回答