community.vmware.vsphere_file – Manage files on a vCenter 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_file
.
Parameters¶
Examples¶
- name: Create an empty file on a datastore
community.vmware.vsphere_file:
host: '{{ vhost }}'
username: '{{ vuser }}'
password: '{{ vpass }}'
datacenter: DC1 Someplace
datastore: datastore1
path: some/remote/file
state: touch
delegate_to: localhost
- name: Create a directory on a datastore
community.vmware.vsphere_file:
host: '{{ vhost }}'
username: '{{ vuser }}'
password: '{{ vpass }}'
datacenter: DC2 Someplace
datastore: datastore2
path: other/remote/file
state: directory
delegate_to: localhost
- name: Query a file on a datastore
community.vmware.vsphere_file:
host: '{{ vhost }}'
username: '{{ vuser }}'
password: '{{ vpass }}'
datacenter: DC1 Someplace
datastore: datastore1
path: some/remote/file
state: touch
delegate_to: localhost
ignore_errors: true
- name: Delete a file on a datastore
community.vmware.vsphere_file:
host: '{{ vhost }}'
username: '{{ vuser }}'
password: '{{ vpass }}'
datacenter: DC2 Someplace
datastore: datastore2
path: other/remote/file
state: absent
delegate_to: localhost
Authors¶
Dag Wieers (@dagwieers)