Skip to content

Commit

Permalink
vmware_dvswitch_pvlans: The VLAN ID type has been updated to be handl…
Browse files Browse the repository at this point in the history
…ed as an integer (ansible-collections#2267)

SUMMARY
This module had a bug that caused an error if the VLAN ID was a string type.
The argument_specs and documentation have been improved to address this issue.
fixes: ansible-collections#2216
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

plugins/modules/vmware_dvswitch_pvlans.py
changelogs/fragments/2216-vmware_dvswitch_pvlans.yml

ADDITIONAL INFORMATION
Tested on VCSA 7.0

Reviewed-by: Mario Lenz <[email protected]>
  • Loading branch information
sky-joker authored Jan 18, 2025
1 parent 6491d02 commit ddaa171
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/2216-vmware_dvswitch_pvlans.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
major_changes:
- vmware_dvswitch_pvlans - The VLAN ID type has been updated to be handled as an integer
(https://github.com/ansible-collections/community.vmware/pull/2267).
37 changes: 34 additions & 3 deletions plugins/modules/vmware_dvswitch_pvlans.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
type: list
default: []
elements: dict
suboptions:
primary_pvlan_id:
description:
- The primary VLAN ID.
- The VLAN IDs of 0 and 4095 are reserved and cannot be used in this option.
type: int
secondary_pvlans:
description:
- A list of VLAN IDs that should be configured as Secondary PVLANs.
Expand All @@ -46,9 +52,26 @@
type: list
default: []
elements: dict
suboptions:
primary_pvlan_id:
description:
- The primary VLAN ID.
- The VLAN IDs of 0 and 4095 are reserved and cannot be used in this option.
type: int
secondary_pvlan_id:
description:
- The type of PVLAN.
type: int
pvlan_type:
description:
- The secondary VLAN ID.
- The VLAN IDs of 0 and 4095 are reserved and cannot be used in this option.
choices:
- community
- isolated
type: str
extends_documentation_fragment:
- community.vmware.vmware.documentation
'''

EXAMPLES = r'''
Expand Down Expand Up @@ -509,8 +532,16 @@ def main():
argument_spec.update(
dict(
switch=dict(required=True, aliases=['dvswitch']),
primary_pvlans=dict(type='list', default=list(), elements='dict'),
secondary_pvlans=dict(type='list', default=list(), elements='dict'),
primary_pvlans=dict(type='list', default=list(), elements='dict',
options=dict(
primary_pvlan_id=dict(type='int')
)),
secondary_pvlans=dict(type='list', default=list(), elements='dict',
options=dict(
primary_pvlan_id=dict(type='int'),
secondary_pvlan_id=dict(type='int'),
pvlan_type=dict(type='str', choices=['community', 'isolated'])
)),
)
)

Expand Down

0 comments on commit ddaa171

Please sign in to comment.