diff --git a/changelogs/fragments/2216-vmware_dvswitch_pvlans.yml b/changelogs/fragments/2216-vmware_dvswitch_pvlans.yml new file mode 100644 index 000000000..123a5c385 --- /dev/null +++ b/changelogs/fragments/2216-vmware_dvswitch_pvlans.yml @@ -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). diff --git a/plugins/modules/vmware_dvswitch_pvlans.py b/plugins/modules/vmware_dvswitch_pvlans.py index 703a19aff..80c01858b 100644 --- a/plugins/modules/vmware_dvswitch_pvlans.py +++ b/plugins/modules/vmware_dvswitch_pvlans.py @@ -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. @@ -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''' @@ -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']) + )), ) )