vmware_dvs_portgroup_find – Find portgroup(s) in a VMware environment¶
New in version 2.9.
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
vmware_dvs_portgroup_find:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
dvswitch: 'vDS'
validate_certs: no
delegate_to: localhost
- name: Confirm if vlan 15 is present
vmware_dvs_portgroup_find:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
vlanid: '15'
validate_certs: no
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
|
on success |
basic details of portgroups found
Sample:
[{'dvswitch': 'vDS', 'name': 'N-51', 'pvlan': True, 'trunk': True, 'vlan_id': '0'}]
|
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- David Martinez (@dx0xm)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.