Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ANSIBLE:将VMware ESX server添加到Vcenter失败,尽管ANSIBLE VMware_主机模块:证书错误_Python_Ansible_Pyvmomi_Vmware Server - Fatal编程技术网

Python ANSIBLE:将VMware ESX server添加到Vcenter失败,尽管ANSIBLE VMware_主机模块:证书错误

Python ANSIBLE:将VMware ESX server添加到Vcenter失败,尽管ANSIBLE VMware_主机模块:证书错误,python,ansible,pyvmomi,vmware-server,Python,Ansible,Pyvmomi,Vmware Server,我正在尝试使用Ansible代码和vmware_主机模块将ESX主机添加到vcenter服务器。它的认证失败了。有什么解决办法吗 --- - hosts: localhost tasks: - name: Add ESXi Host to VCSA local_action: module: vmware_host hostname: xxxxxxxxxx username: administr

我正在尝试使用Ansible代码和vmware_主机模块将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

尝试将
validate\u 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

哦,是的,实际上我试过了,正如其他人在论坛中提到的,但看起来这个参数不再受支持了。ansible playbook sample.yml任务[将ESXi主机添加到VCSA]************************************************************************致命:[本地主机->本地主机]:失败!=>{“更改”:false,“failed”:true,“msg”:“模块不支持的参数:验证证书”}播放回放************************************************************************************************************************本地主机:ok=1已更改=0无法访问=0失败=1@user3802947呃:/