简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM