community.vmware.vcenter_folder – Manage folders on given datacenter¶
Note
This plugin is part of the community.vmware collection (version 1.9.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vcenter_folder
.
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
community.vmware.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
community.vmware.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
community.vmware.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
community.vmware.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
|
success |
string stating about result
|
|
path
string
|
success |
the full path of the new folder
|
Authors¶
Abhijeet Kasurde (@Akasurde)
Christian Kotte (@ckotte) <christian.kotte@gmx.de>
Jan Meerkamp (@meerkampdvv)