【问题标题】:ANSIBLE: Adding VMware ESX server to Vcenter Failing though Ansible vmware_host module: Certificate ErrorANSIBLE:通过 Ansible vmware_host 模块将 VMware ESX 服务器添加到 Vcenter 失败:证书错误
【发布时间】:2017-05-14 18:33:18
【问题描述】:

我正在尝试使用 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

【问题讨论】:

    标签: python ansible pyvmomi vmware-server


    【解决方案1】:

    尝试将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
    

    【讨论】:

    • 哦,是的,实际上我尝试过,正如论坛中其他人提到的那样,但看起来这个参数不再受支持。 ansible-playbook sample.yml 任务 [将 ESXi 主机添加到 VCSA] ************************************ ****************** 致命:[localhost -> localhost]:失败! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: validate_certs"} PLAY RECAP ******************** ************************************************* 本地主机: ok=1 changed=0 unreachable=0 failed=1
    • @user3802947 嗯:/
    猜你喜欢
    • 1970-01-01
    • 2019-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-02
    • 1970-01-01
    • 1970-01-01
    • 2015-07-21
    相关资源
    最近更新 更多