community.vmware.vmware_dvs_portgroup_find – Find portgroup(s) in a VMware environment¶
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.vmware_dvs_portgroup_find
.
Synopsis¶
Find portgroup(s) based on different criteria such as distributed vSwitch, VLAN id or a string in the name.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
PyVmomi
Parameters¶
Examples¶
- name: Get all portgroups in dvswitch vDS
community.vmware.vmware_dvs_portgroup_find:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
dvswitch: 'vDS'
delegate_to: localhost
- name: Confirm if vlan 15 is present
community.vmware.vmware_dvs_portgroup_find:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
vlanid: '15'
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
dvs_portgroups
list
/ elements=string
|
on success |
basic details of portgroups found
Sample:
[{'dvswitch': 'vDS', 'name': 'N-51', 'pvlan': True, 'trunk': True, 'vlan_id': '0'}]
|
Authors¶
David Martinez (@dx0xm)