Skip to content

Commit

Permalink
vmware_dsv_portgroup_info: Add moid property in the return value and …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
sky-joker authored Oct 8, 2023
1 parent 9e7cf8e commit ec6aaa5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/1855_ vmware_dsv_portgroup_info.yml
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion docs/community.vmware.vmware_dvs_portgroup_info_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
<div>metadata about DVS portgroup configuration</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{&#x27;dvs_0&#x27;: [{&#x27;description&#x27;: None, &#x27;dvswitch_name&#x27;: &#x27;dvs_001&#x27;, &#x27;network_policy&#x27;: {&#x27;forged_transmits&#x27;: False, &#x27;mac_changes&#x27;: False, &#x27;promiscuous&#x27;: False}, &#x27;num_ports&#x27;: 8, &#x27;port_policy&#x27;: {&#x27;block_override&#x27;: True, &#x27;ipfix_override&#x27;: False, &#x27;live_port_move&#x27;: False, &#x27;network_rp_override&#x27;: False, &#x27;port_config_reset_at_disconnect&#x27;: True, &#x27;security_override&#x27;: False, &#x27;shaping_override&#x27;: False, &#x27;traffic_filter_override&#x27;: False, &#x27;uplink_teaming_override&#x27;: False, &#x27;vendor_config_override&#x27;: False, &#x27;vlan_override&#x27;: False}, &#x27;portgroup_name&#x27;: &#x27;dvpg_001&#x27;, &#x27;teaming_policy&#x27;: {&#x27;inbound_policy&#x27;: True, &#x27;notify_switches&#x27;: True, &#x27;policy&#x27;: &#x27;loadbalance_srcid&#x27;, &#x27;rolling_order&#x27;: False}, &#x27;vlan_info&#x27;: {&#x27;trunk&#x27;: False, &#x27;pvlan&#x27;: False, &#x27;vlan_id&#x27;: 0}, &#x27;type&#x27;: &#x27;earlyBinding&#x27;}]}</div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{&#x27;dvs_0&#x27;: [{&#x27;active_uplinks&#x27;: [&#x27;uplink 1&#x27;], &#x27;description&#x27;: None, &#x27;dvswitch_name&#x27;: &#x27;dvs_001&#x27;, &#x27;key&#x27;: &#x27;dvportgroup-1014&#x27;, &#x27;mac_learning&#x27;: {&#x27;allow_unicast_flooding&#x27;: None, &#x27;enabled&#x27;: False, &#x27;limit&#x27;: None, &#x27;limit_policy&#x27;: None}, &#x27;moid&#x27;: &#x27;dvportgroup-1014&#x27;, &#x27;network_policy&#x27;: {&#x27;forged_transmits&#x27;: False, &#x27;mac_changes&#x27;: False, &#x27;promiscuous&#x27;: False}, &#x27;num_ports&#x27;: 8, &#x27;port_allocation&#x27;: &#x27;elastic&#x27;, &#x27;port_binding&#x27;: &#x27;static&#x27;, &#x27;standby_uplinks&#x27;: [], &#x27;port_policy&#x27;: {&#x27;block_override&#x27;: True, &#x27;ipfix_override&#x27;: False, &#x27;live_port_move&#x27;: False, &#x27;network_rp_override&#x27;: False, &#x27;port_config_reset_at_disconnect&#x27;: True, &#x27;security_override&#x27;: False, &#x27;shaping_override&#x27;: False, &#x27;traffic_filter_override&#x27;: False, &#x27;uplink_teaming_override&#x27;: False, &#x27;vendor_config_override&#x27;: False, &#x27;vlan_override&#x27;: False}, &#x27;portgroup_name&#x27;: &#x27;dvpg_001&#x27;, &#x27;teaming_policy&#x27;: {&#x27;inbound_policy&#x27;: True, &#x27;notify_switches&#x27;: True, &#x27;policy&#x27;: &#x27;loadbalance_srcid&#x27;, &#x27;rolling_order&#x27;: False}, &#x27;vlan_info&#x27;: {&#x27;trunk&#x27;: False, &#x27;pvlan&#x27;: False, &#x27;vlan_id&#x27;: 0}, &#x27;type&#x27;: &#x27;earlyBinding&#x27;}]}</div>
</td>
</tr>
</table>
Expand Down
15 changes: 15 additions & 0 deletions plugins/modules/vmware_dvs_portgroup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ec6aaa5

Please sign in to comment.