community / community.vmware / 4.2.0 / connection / vmware_tools Execute tasks inside a VM via VMware Tools Authors: Deric Crago (@dericcrago) <deric.crago@gmail.com>community.vmware.vmware_tools (4.2.0) — connection
Install with ansible-galaxy collection install community.vmware:==4.2.0
collections: - name: community.vmware version: 4.2.0
Use VMware tools to run tasks in, or put/fetch files to guest operating systems running in VMware infrastructure.
In case of Windows VMs, set C(ansible_shell_type) to C(powershell).
Does not work with C(become).
vm_path: description: - Mutually exclusive with O(vm_uuid) - VM path absolute to the connection. - 'vCenter Example: V(Datacenter/vm/Discovered virtual machine/testVM).' - 'ESXi Host Example: V(ha-datacenter/vm/testVM).' - Must include VM name, appended to 'folder' as would be passed to M(community.vmware.vmware_guest). - Needs to include I(vm) between the Datacenter and the rest of the VM path. - Datacenter default value for ESXi server is C(ha-datacenter). - Folder I(vm) is not visible in the vSphere Web Client but necessary for VMware API to work. required: false vars: - name: ansible_vmware_guest_path vm_user: description: - VM username. - C(ansible_vmware_tools_user) is used for connecting to the VM. - C(ansible_user) is used by Ansible on the VM. required: true vars: - name: ansible_user - name: ansible_vmware_tools_user vm_uuid: description: - Mutually exclusive with O(vm_path) - VM UUID to the connection. - UUID of the virtual machine from property config.uuid of P(community.vmware.vmware_vm_inventory#lookup) plugin required: false vars: - name: ansible_vmware_guest_uuid executable: default: /bin/sh description: - shell to use for execution inside container env: - name: ANSIBLE_EXECUTABLE ini: - key: executable section: defaults vars: - name: ansible_executable - name: ansible_vmware_tools_executable vm_password: description: - Password for the user in guest operating system. required: true vars: - name: ansible_password - name: ansible_vmware_tools_password vmware_host: description: - FQDN or IP Address for the connection (vCenter or ESXi Host). env: - name: VI_SERVER - name: VMWARE_HOST required: true vars: - name: ansible_host - name: ansible_vmware_host vmware_port: default: 443 description: - Port for the connection. env: - name: VI_PORTNUMBER - name: VMWARE_PORT required: false vars: - name: ansible_port - name: ansible_vmware_port vmware_user: description: - Username for the connection. - 'Requires the following permissions on the VM: - VirtualMachine.GuestOperations.Execute - VirtualMachine.GuestOperations.Modify - VirtualMachine.GuestOperations.Query' env: - name: VI_USERNAME - name: VMWARE_USER required: true vars: - name: ansible_vmware_user validate_certs: default: true description: - Verify SSL for the connection. - 'Note: This will validate certs for both O(vmware_host) and the ESXi host running the VM.' env: - name: VMWARE_VALIDATE_CERTS type: bool vars: - name: ansible_vmware_validate_certs file_chunk_size: default: 128 description: - File chunk size. - '(Applicable when writing a file to disk, example: using the M(ansible.builtin.fetch) module.)' type: integer vars: - name: ansible_vmware_tools_file_chunk_size vmware_password: description: - Password for the connection. env: - name: VI_PASSWORD - name: VMWARE_PASSWORD required: true vars: - name: ansible_vmware_password exec_command_sleep_interval: default: 0.5 description: - Time in seconds to sleep between execution of command. type: float vars: - name: ansible_vmware_tools_exec_command_sleep_interval