2016-09-06 187 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过度推包并安装它。