community.vmware.vmware_folder_info – Provides information about folders in a 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.vmware_folder_info
.
Synopsis¶
The module can be used to gather a hierarchical view of the folders that exist within a datacenter
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
Parameters¶
Examples¶
- name: Provide information about vCenter folders
community.vmware.vmware_folder_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: datacenter_name
delegate_to: localhost
register: vcenter_folder_info
- name: Get information about folders
community.vmware.vmware_folder_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: 'Asia-Datacenter1'
register: r
- name: Set Managed object ID for the given folder
ansible.builtin.set_fact:
folder_mo_id: "{{ (r.flat_folder_info | selectattr('path', 'equalto', '/Asia-Datacenter1/vm/tier1/tier2') | map(attribute='moid'))[0] }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
David Hewitt (@davidmhewitt)