尝试安装 vmware 工具时出现服务工具错误

Get service tool error when trying to install vmware tools

我正在尝试在 EXSi 主机上安装 vmware 工具。这是我必须执行的代码。

---
- hosts: my-host


  tasks:

      - name: Install VMware tools 
        yum: pkg="open-vm-tools" state=present
        when: ansible_os_family == "RedHat"

      - name: Enabling and starting -> vmtoolsd 
        service: name=vmtoolsd enabled=yes state=started

这是我在 运行 代码后得到的错误。

PLAY [my-host]


TASK [setup] ******************************************************************* ok: [myhost.com]

TASK [Install VMware tools] **************************************************** skipping: [myhost.com]

TASK [Enabling and starting -> vmtoolsd] *************************************** fatal: [myhost.com]: FAILED! => {"changed": false, "failed": true, "msg": "get_service_tools not implemented on target platform"}

NO MORE HOSTS LEFT ************************************************************* [WARNING]: Could not create retry file 'vmwaretools.retry'.
[Errno 2] No such file or directory: ''

PLAY RECAP ********************************************************************* myhost.com : ok=1 changed=0 unreachable=0
failed=1

这是我正在使用的主机文件。

[my-host] myhost.com ansible_ssh_pass=mypw ansible_ssh_user=root

如何像错误消息指出的那样在我的主机上实施 get_service_tools?我对这一切还很陌生,所以请原谅我的天真。谢谢

来自评论的回答:

As in the , you need to execute tasks on your guest hosts, not on your host esxi.