Das installieren der vmware-tools auf Linux Rechnern, kann manchmal lästig sein. Was viele nicht wissen:
Anstelle der manuellen Installation kann man das Packet: open-vm-tools
installieren (via: yum install open-vm-tools).
Das wird von vmware fully supported.
Bei CentOS6 ist es im EPEL repository drin, ab CentOS7 sogar im core repository.
Ein ansible-playbook dafür könnte so aussheen:
---
- hosts: vmware-servers
tasks:
# PREREQUISITES: For RHEL < 7 we need the EPEL repository
- name: install the EPEL repo
yum: pkg=epel-release state=latest
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version == "6")
name: install the EPEL repo
yum: name=https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version == "5")
# install open-vm-tools
- name: install open-vm-tools
yum: pkg=open-vm-tools state=latest
when: ansible_os_family == "RedHat"
- name: install open-vm-tools
apt: pkg=open-vm-tools state=latest
when: ansible_os_family == "Debian"
# startup
- name: ensure vmware-tools are running and started automatically
service: name=vmtoolsd state=started enabled=yes
when: ansible_os_family == "RedHat"
- name: ensure vmware-tools are running and started automatically
service: name=open-vm-tools state=started enabled=yes
when: ansible_os_family == "Debian" |
---
- hosts: vmware-servers
tasks:
# PREREQUISITES: For RHEL < 7 we need the EPEL repository
- name: install the EPEL repo
yum: pkg=epel-release state=latest
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version == "6")
name: install the EPEL repo
yum: name=https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version == "5")
# install open-vm-tools
- name: install open-vm-tools
yum: pkg=open-vm-tools state=latest
when: ansible_os_family == "RedHat"
- name: install open-vm-tools
apt: pkg=open-vm-tools state=latest
when: ansible_os_family == "Debian"
# startup
- name: ensure vmware-tools are running and started automatically
service: name=vmtoolsd state=started enabled=yes
when: ansible_os_family == "RedHat"
- name: ensure vmware-tools are running and started automatically
service: name=open-vm-tools state=started enabled=yes
when: ansible_os_family == "Debian"