使用ansible在Windows vm上安装vmware工具

时间:2016-09-06 23:17:40

标签: ansible ansible-playbook vmware-tools

我正在尝试使用ansible在guest虚拟机上安装vmware工具。我在网上看到的大多数例子都是使用open-vm-tools在linux上进行的。这是一个例子。

    - name: debian | installing open-vm-tools
  apt: name=open-vm-tools state=present
  when: ansible_os_family == "Debian" and ansible_virtualization_type == "VMware"

- name: centos | installing open-vm-tools if a vm
  yum: name=open-vm-tools state=present
  when: ansible_os_family == "Redhat" and ansible_virtualization_type == "VMware"

- name: centos | starting and enabling open-vm-tools
  service: name=vmtoolsd.service state=restarted enabled=yes
  when: ansible_os_family == "Redhat" and ansible_virtualization_type == "VMware"

是否有一个如何在Windows中执行此操作的示例?

1 个答案:

答案 0 :(得分:1)

建议使用win_chocolatey自动下载和安装,例如:

- name: install vmware tools via Chocolatey
  win_chocolatey: name="vmware-tools"

否则,win_copy + win_package推送包并安装它。