vcenter_folder – Manage folders on given datacenter¶
New in version 2.5.
Synopsis¶
- This module can be used to create, delete, move and rename folder on then given datacenter.
- This module is only supported for vCenter.
Requirements¶
The below requirements are needed on the host that executes this module.
- python >= 2.6
- PyVmomi
Parameters¶
Examples¶
- name: Create a VM folder on given datacenter
vcenter_folder:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter_name
folder_name: sample_vm_folder
folder_type: vm
state: present
register: vm_folder_creation_result
delegate_to: localhost
- name: Create a datastore folder on given datacenter
vcenter_folder:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter_name
folder_name: sample_datastore_folder
folder_type: datastore
state: present
register: datastore_folder_creation_result
delegate_to: localhost
- name: Create a sub folder under VM folder on given datacenter
vcenter_folder:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter_name
folder_name: sample_sub_folder
parent_folder: vm_folder
state: present
register: sub_folder_creation_result
delegate_to: localhost
- name: Delete a VM folder on given datacenter
vcenter_folder:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter_name
folder_name: sample_vm_folder
folder_type: vm
state: absent
register: vm_folder_deletion_result
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
result
complex
|
On success |
The detail about the new folder
|
|
msg
string
|
string stating about result
|
||
path
string
|
the full path of the new folder
|
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Abhijeet Kasurde (@Akasurde)
- Christian Kotte (@ckotte) <christian.kotte@gmx.de>
Hint
If you notice any issues in this documentation, you can edit this document to improve it.