community.vmware.vsphere_copy – Copy a file to a VMware datastore¶
Note
This plugin is part of the community.vmware collection (version 1.7.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vsphere_copy
.
Parameters¶
Notes¶
Note
This module ought to be run from a system that can access the vCenter or the ESXi directly and has the file to transfer. It can be the normal remote target or you can change it either by using
transport: local
or usingdelegate_to
.Tested on vSphere 5.5 and ESXi 6.7
Examples¶
- name: Copy file to datastore using delegate_to
community.vmware.vsphere_copy:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
src: /some/local/file
datacenter: DC1 Someplace
datastore: datastore1
path: some/remote/file
delegate_to: localhost
- name: Copy file to datastore when datacenter is inside folder called devel
community.vmware.vsphere_copy:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
src: /some/local/file
datacenter: devel/DC1
datastore: datastore1
path: some/remote/file
delegate_to: localhost
- name: Copy file to datastore using other_system
community.vmware.vsphere_copy:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
src: /other/local/file
datacenter: DC2 Someplace
datastore: datastore2
path: other/remote/file
delegate_to: other_system
Authors¶
Dag Wieers (@dagwieers)