【发布时间】:2016-09-02 04:43:00
【问题描述】:
这是我运行此代码时遇到的错误。
[my-host]
19.3.112.97 ansible_ssh_pass=mypass ansible_ssh_user=root
剧本是
---
- hosts: localhost
connection: local
tasks:
- vsphere_guest:
guest: newvm001
vmware_guest_facts: yes
错误:
任务执行期间发生异常。完整的追溯是: Traceback(最近一次通话最后一次):文件 "/var/folders/zt/s5ykx9_n4y9611h_k_gj_vx00000gn/T/ansible_vYePRK/ansible_module_vsphere_guest.py", 第 1879 行,在 主()文件“/var/folders/zt/s5ykx9_n4y9611h_k_gj_vx00000gn/T/ansible_vYePRK/ansible_module_vsphere_guest.py”, 第 1748 行,主要 viserver.connect(vcenter_hostname, username, password) 文件“/Library/Python/2.7/site-packages/pysphere/vi_server.py”,第 71 行,在 连接 ,FaultTypes.PARAMETER_ERROR) pysphere.resources.vi_exception.VIException: [参数错误]: 'host' 应该是一个带有 ESX/VC url 的字符串。
致命:[9.1.142.86]:失败! => {“改变”:假,“失败”:真, “调用”:{“module_name”:“vsphere_guest”},“module_stderr”: "回溯(最近一次调用最后一次):\n 文件 \"/var/folders/zt/s5ykx9_n4y9611h_k_gj_vx00000gn/T/ansible_vYePRK/ansible_module_vsphere_guest.py\", 第 1879 行,在 \n main()\n 文件中 \"/var/folders/zt/s5ykx9_n4y9611h_k_gj_vx00000gn/T/ansible_vYePRK/ansible_module_vsphere_guest.py\", 第 1748 行,在 main\n viserver.connect(vcenter_hostname, username, 密码)\n 文件 \"/Library/Python/2.7/site-packages/pysphere/vi_server.py\",第 71 行, 连接中\n
,FaultTypes.PARAMETER_ERROR)\npysphere.resources.vi_exception.VIException: [参数错误]: 'host' 应该是带有 ESX/VC url 的字符串。\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}
为什么会出现这个错误?
【问题讨论】:
-
这是什么,你对同一段代码的第八个问题?而且您还没有接受要求澄清的答案?
标签: ansible vmware ansible-playbook