summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2019-08-01 15:14:17 +0530
committerGitHub <noreply@github.com>2019-08-01 15:14:17 +0530
commit07e7b69c04116f598ed2376616cbb46343d9a0e9 (patch)
tree60e2a9af9e53baeb25abb63f56685e0e9459bbc8
parentc35b512413a8caa1b1966d6ecd80c76916f38ff6 (diff)
downloadansible-07e7b69c04116f598ed2376616cbb46343d9a0e9.tar.gz
VMware: minor changes in vmware_dvs_portgroup_find (#59911)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
-rw-r--r--lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_find.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_find.py b/lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_find.py
index e7d6c537ad..a5d3005dbc 100644
--- a/lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_find.py
+++ b/lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_find.py
@@ -17,9 +17,9 @@ ANSIBLE_METADATA = {
DOCUMENTATION = r'''
---
module: vmware_dvs_portgroup_find
-short_description: Find portgroup(s) in a vmware environment
+short_description: Find portgroup(s) in a VMware environment
description:
-- Find portgroup(s) based on different criteria such as dvswitch, vlan id or a string in the name.
+- Find portgroup(s) based on different criteria such as distributed vSwitch, VLAN id or a string in the name.
version_added: 2.9
author:
- David Martinez (@dx0xm)
@@ -31,12 +31,12 @@ requirements:
options:
dvswitch:
description:
- - Name of a dvswitch to look for.
+ - Name of a distributed vSwitch to look for.
type: str
vlanid:
description:
- - vlan id can be any number between 1 and 4094.
- - This search criteria will looks into vlan ranges to find possible matches.
+ - VLAN id can be any number between 1 and 4094.
+ - This search criteria will looks into VLAN ranges to find possible matches.
required: false
type: int
name:
@@ -56,16 +56,21 @@ extends_documentation_fragment: vmware.documentation
EXAMPLES = r'''
- name: Get all portgroups in dvswitch vDS
vmware_dvs_portgroup_find:
- hostname: 172.16.143.150
- username: admin
- password: password
+ 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: 172.16.143.150
- username: admin
- password: password
+ hostname: "{{ vcenter_hostname }}"
+ username: "{{ vcenter_username }}"
+ password: "{{ vcenter_password }}"
vlanid: '15'
+ validate_certs: no
+ delegate_to: localhost
'''
RETURN = r'''
@@ -194,7 +199,9 @@ def main():
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
- required_if=[['show_uplink', 'True', 'vlanid']]
+ required_if=[
+ ['show_uplink', 'True', 'vlanid']
+ ]
)
dvs_pg_mgr = DVSPortgroupFindManager(module)