vsphere_copy – Copy a file to a VMware datastore¶
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
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
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
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
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Dag Wieers (@dagwieers)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.