2016-09-06 185 views
0

我正嘗試在guest虛擬機上安裝vmware工具,使用ansible。我在網上看到的大多數例子都是在linux上使用open-vm-tools。下面是一個例子。在windows vm上使用安裝程序安裝vmware工具

- 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

建議使用win_chocolatey自動下載並安裝,如:

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

否則,win_copy + win_package過度推包並安裝它。