From 07e7b69c04116f598ed2376616cbb46343d9a0e9 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 1 Aug 2019 15:14:17 +0530 Subject: [PATCH] VMware: minor changes in vmware_dvs_portgroup_find (#59911) Signed-off-by: Abhijeet Kasurde --- .../cloud/vmware/vmware_dvs_portgroup_find.py | 31 ++++++++++++------- 1 file 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 e7d6c537ad6..a5d3005dbc1 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)