2017-05-14 57 views
0

我嘗試使用Ansible代碼和vmware_host模塊將ESX主機添加到vCenter Server。它在驗證驗證中失敗。有沒有解決這個問題的方法?ANSIBLE:將VMware ESX服務器添加到Vcenter雖然Ansible vmware_host模塊失敗:證書錯誤

--- 
- hosts: localhost 
    tasks: 
     - name: Add ESXi Host to VCSA 
     local_action: 
      module: vmware_host 
      hostname: xxxxxxxxxx 
      username: [email protected] 
      password: xxxxx 
      datacenter_name: Datacenter 
      cluster_name: cluster1 
      esxi_hostname: xxxxx 
      esxi_username: root 
      esxi_password: xxxx 
      state: present 

這是我的任務的輸出:

[email protected]:/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 

回答

0

嘗試添加validate_certs: False給你的任務:

--- 
- hosts: localhost 
    tasks: 
     - name: Add ESXi Host to VCSA 
     local_action: 
      module: vmware_host 
      hostname: xxxxxxxxxx 
      username: [email protected] 
      password: xxxxx 
      datacenter_name: Datacenter 
      cluster_name: cluster1 
      esxi_hostname: xxxxx 
      esxi_username: root 
      esxi_password: xxxx 
      state: present 
      validate_certs: False 
+0

哦,是的其實我想,在論壇中提到的otrher人,但看起來像這個參數不再被支持。 ansible-playbook sample.yml TASK [將ESXi主機添加到VCSA] ******************************** ******************* 致命:[localhost - > localhost]:失敗! => {「changed」:false,「failed」:true,「msg」:「模塊的不支持參數:validate_certs」} PLAY RECAP ****************** ************************************************** * localhost:ok = 1 changed = 0 unreachable = 0 failed = 1 – user3802947

+0

@ user3802947 Ehhh:/ – errata