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,