ansible updating vmware tools on windows vms

206 views
Skip to first unread message

Tony Wong

unread,
Apr 12, 2020, 1:16:23 PM4/12/20
to Ansible Project
does anyone have a playbook or how do i get started with a playbook updating vmwasr tools on windows guests?

David Foley

unread,
Apr 12, 2020, 1:36:26 PM4/12/20
to Ansible Project
Trythe following code,
I am because the tools moulde is looking for a UUID of the Machine I'm first doing a Gather_facts on that machine inorder to get the UUID then importing that as a variable in the next task


:---
- name: Running VMTools Playbook
hosts: localhost
gather_facts: false
connection: local
tasks:
- name: Get Virtual Machine info
vmware_guest_info:
validate_certs: no
hostname: "{{ vcenter_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
datacenter: "{{ datacenter_name }}"
name: "{{ VM_Name }}"
schema: "vsphere"
properties:
delegate_to: localhost
register: vminfo

- name: Updating VM Tools
vmware_guest_tools_upgrade:
validate_certs: no
hostname: "{{ vcenter_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
datacenter: "{{ datacenter_name }}"
uuid: "{{ vminfo.instance.config.uuid }}"
delegate_to: localhost

Tony Wong

unread,
Apr 12, 2020, 6:20:26 PM4/12/20
to Ansible Project
I created a yml file like this. I just need to test it on one vm. 

---
- hosts all
  gather_facts: false
  connection: local
  user: remote

  vars:
    vcenter_hostname: 'vcenter.domain.com'
    username: 'admini...@vsphere.local'
    password: 'xxxxxxxx'
    datacenter_name: 'DC1'
    VM_Name: 'vm1'
what else do i need?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages