.. _dellemc.enterprise_sonic.sonic_vlans_module: ************************************ dellemc.enterprise_sonic.sonic_vlans ************************************ **Manage VLAN and its parameters** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module provides configuration management of VLANs parameters on devices running Enterprise SONiC Distribution by Dell Technologies. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A dictionary of VLAN options.
autostate
boolean
added in 3.1.0
    Choices:
  • no
  • yes
Enable or disable autostate functionality for the VLAN interface.
Default value for this field if not configured yet will be "enable" which is equivalent to true.
description
string
Description about the VLAN.
vlan_id
integer / required
ID of the VLAN
Range is 1 to 4094
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
The state that the configuration should be left in.

Notes ----- .. note:: - Tested against Enterprise SONiC Distribution by Dell Technologies. - Supports ``check_mode``. Examples -------- .. code-block:: yaml # Using "merged" state # Before state: # ------------- # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 30 Inactive # # sonic# # - name: Merges given VLAN attributes with the device configuration dellemc.enterprise_sonic.sonic_vlans: config: - vlan_id: 10 description: "Internal" state: merged # After state: # ------------ # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 30 Inactive # # sonic# # # sonic# show interface Vlan 10 # Description: Internal # Vlan10 is up # Mode of IPV4 address assignment: not-set # Mode of IPV6 address assignment: not-set # IP MTU 6000 bytes # sonic# # # Using "replaced" state # Before state: # ------------- # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 30 Inactive # # sonic# - name: Replace all attributes of specified VLANs with provided configuration dellemc.enterprise_sonic.sonic_vlans: config: - vlan_id: 10 state: replaced # After state: # ------------ # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 30 Inactive # # sonic# # Using "overridden" state # Before state: # ------------- # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 30 Inactive # # sonic# - name: Override device configuration of all VLANs with provided configuration dellemc.enterprise_sonic.sonic_vlans: config: - vlan_id: 10 state: overridden # After state: # ------------ # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # # sonic# # Using "deleted" state # Before state: # ------------- # # sonic# show interface Vlan 70 # Description: Internal # Vlan70 is up # Mode of IPV4 address assignment: not-set # Mode of IPV6 address assignment: not-set # IP MTU 6000 bytes - name: Deletes attributes of the given VLANs dellemc.enterprise_sonic.sonic_vlans: config: - vlan_id: 70 description: "Internal" state: deleted # After state: # ------------ # # sonic# show interface Vlan 70 # Vlan70 is up # Mode of IPV4 address assignment: not-set # Mode of IPV6 address assignment: not-set # IP MTU 6000 bytes # Before state: # ------------- # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 20 Inactive # # sonic# - name: Deletes attributes of the given VLANs dellemc.enterprise_sonic.sonic_vlans: config: - vlan_id: 20 state: deleted # After state: # ------------ # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # # sonic# # Using "deleted" state # Before state: # ------------- # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # 10 Inactive # 20 Inactive # 30 Inactive # # sonic# - name: Deletes all the VLANs on the switch dellemc.enterprise_sonic.sonic_vlans: config: state: deleted # After state: # ------------ # # sonic# show Vlan # Q: A - Access (Untagged), T - Tagged # NUM Status Q Ports # # sonic# Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
The resulting configuration module invocation.

Sample:
The configuration returned is always in the same format as the parameters above.
before
list
always
The configuration prior to the module invocation.

Sample:
The configuration that is returned is always in the same format as the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['command 1', 'command 2', 'command 3']


Status ------ Authors ~~~~~~~ - Mohamed Javeed (@javeedf)