From ec6aaa519e009c0b9961a0be2506b5f2d743de90 Mon Sep 17 00:00:00 2001 From: sky-joker Date: Sun, 8 Oct 2023 22:11:01 +0900 Subject: [PATCH] vmware_dsv_portgroup_info: Add moid property in the return value and modify the return example (#1855) vmware_dsv_portgroup_info: Add moid property in the return value and modify the return example SUMMARY This PR is to add moid property in the return value for the module and modify the return example document. fixes: #1849 ISSUE TYPE Feature Pull Request COMPONENT NAME changelogs/fragments/1855_ vmware_dsv_portgroup_info.yml docs/community.vmware.vmware_dvs_portgroup_info_module.rst plugins/modules/vmware_dvs_portgroup_info.py ADDITIONAL INFORMATION tested in VCSA 7.0 Reviewed-by: Mario Lenz --- .../fragments/1855_ vmware_dsv_portgroup_info.yml | 2 ++ ...ty.vmware.vmware_dvs_portgroup_info_module.rst | 2 +- plugins/modules/vmware_dvs_portgroup_info.py | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1855_ vmware_dsv_portgroup_info.yml diff --git a/changelogs/fragments/1855_ vmware_dsv_portgroup_info.yml b/changelogs/fragments/1855_ vmware_dsv_portgroup_info.yml new file mode 100644 index 000000000..334bc9bd2 --- /dev/null +++ b/changelogs/fragments/1855_ vmware_dsv_portgroup_info.yml @@ -0,0 +1,2 @@ +minor_changes: + - add moid property in the return value for the module(https://github.com/ansible-collections/community.vmware/pull/1855). diff --git a/docs/community.vmware.vmware_dvs_portgroup_info_module.rst b/docs/community.vmware.vmware_dvs_portgroup_info_module.rst index c245c66ed..fab39eba1 100644 --- a/docs/community.vmware.vmware_dvs_portgroup_info_module.rst +++ b/docs/community.vmware.vmware_dvs_portgroup_info_module.rst @@ -365,7 +365,7 @@ Common return values are documented `here metadata about DVS portgroup configuration
Sample:
-
{'dvs_0': [{'description': None, 'dvswitch_name': 'dvs_001', 'network_policy': {'forged_transmits': False, 'mac_changes': False, 'promiscuous': False}, 'num_ports': 8, 'port_policy': {'block_override': True, 'ipfix_override': False, 'live_port_move': False, 'network_rp_override': False, 'port_config_reset_at_disconnect': True, 'security_override': False, 'shaping_override': False, 'traffic_filter_override': False, 'uplink_teaming_override': False, 'vendor_config_override': False, 'vlan_override': False}, 'portgroup_name': 'dvpg_001', 'teaming_policy': {'inbound_policy': True, 'notify_switches': True, 'policy': 'loadbalance_srcid', 'rolling_order': False}, 'vlan_info': {'trunk': False, 'pvlan': False, 'vlan_id': 0}, 'type': 'earlyBinding'}]}
+
{'dvs_0': [{'active_uplinks': ['uplink 1'], 'description': None, 'dvswitch_name': 'dvs_001', 'key': 'dvportgroup-1014', 'mac_learning': {'allow_unicast_flooding': None, 'enabled': False, 'limit': None, 'limit_policy': None}, 'moid': 'dvportgroup-1014', 'network_policy': {'forged_transmits': False, 'mac_changes': False, 'promiscuous': False}, 'num_ports': 8, 'port_allocation': 'elastic', 'port_binding': 'static', 'standby_uplinks': [], 'port_policy': {'block_override': True, 'ipfix_override': False, 'live_port_move': False, 'network_rp_override': False, 'port_config_reset_at_disconnect': True, 'security_override': False, 'shaping_override': False, 'traffic_filter_override': False, 'uplink_teaming_override': False, 'vendor_config_override': False, 'vlan_override': False}, 'portgroup_name': 'dvpg_001', 'teaming_policy': {'inbound_policy': True, 'notify_switches': True, 'policy': 'loadbalance_srcid', 'rolling_order': False}, 'vlan_info': {'trunk': False, 'pvlan': False, 'vlan_id': 0}, 'type': 'earlyBinding'}]}
diff --git a/plugins/modules/vmware_dvs_portgroup_info.py b/plugins/modules/vmware_dvs_portgroup_info.py index d80d4ec17..1a07e142d 100644 --- a/plugins/modules/vmware_dvs_portgroup_info.py +++ b/plugins/modules/vmware_dvs_portgroup_info.py @@ -90,14 +90,28 @@ sample: { "dvs_0":[ { + "active_uplinks": [ + "uplink 1" + ], "description": null, "dvswitch_name": "dvs_001", + "key": "dvportgroup-1014", + "mac_learning": { + "allow_unicast_flooding": null, + "enabled": false, + "limit": null, + "limit_policy": null + }, + "moid": "dvportgroup-1014", "network_policy": { "forged_transmits": false, "mac_changes": false, "promiscuous": false }, "num_ports": 8, + "port_allocation": "elastic", + "port_binding": "static", + "standby_uplinks": [], "port_policy": { "block_override": true, "ipfix_override": false, @@ -264,6 +278,7 @@ def gather_dvs_portgroup_info(self): dvpg_details = dict( portgroup_name=unquote(dvs_pg.name), + moid=dvs_pg._moId, num_ports=dvs_pg.config.numPorts, dvswitch_name=dvs_pg.config.distributedVirtualSwitch.name, description=dvs_pg.config.description,