ansiblevmware-tools

Installing vmware tools on a windows vm using ansible


I am trying to install vmware tools on a guest vm using ansible. Most of the examples I have seen online have been on linux using open-vm-tools. This an example below.

    - 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"

Is there an example of how to do it in windows?


Solution

  • Would suggest using win_chocolatey to automatically download and install, eg:

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

    Otherwise, win_copy + win_package to push the package over and install it.