This module has a single purposeāto copy a local file to a remote data store:
- name: copy file to datastore
vsphere_copy:
hostname: "{{ vsphere_host }}"
username: "{{ vsphere_username }}"
password: "{{ vsphere_password }}"
src: "/path/to/local/file"
datacenter: "my_datacenter"
datastore: "my_datastore"
path: "path/to/remove/file"
transport: local
As you can see, we are copying the file from /path/to/local/file to path/to/remove/file in the my_datastore data store which is hosted in the my_datacenter data center.