.. _dellemc.enterprise_sonic.sonic_vrfs_module: *********************************** dellemc.enterprise_sonic.sonic_vrfs *********************************** **Manage VRFs and associate VRFs to interfaces such as, Eth, LAG, VLAN, and loopback** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages VRF and VRF interface attributes in Enterprise SONiC Distribution by Dell Technologies. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A list of VRF configurations.
members
dictionary
Holds a dictionary mapping of list of interfaces linked to a VRF interface.
interfaces
list / elements=dictionary
List of interface names that are linked to a specific VRF interface.
name
string
The name of the physical interface.
name
string / required
The name of the VRF interface.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
The state of the configuration after module completion.

Notes ----- .. note:: - Tested against Enterprise SONiC Distribution by Dell Technologies. - Supports ``check_mode``. - This module does not support the deletion of mgmt VRF. Deletion of mgmt VRF can be done using the "sonic_config" resource module as shown in "playbooks/common_examples/mgmt_vrf_off.yaml". It can also be done using the SONiC CLI or by using a standalone REST API. Examples -------- .. code-block:: yaml # Using "deleted" state # # Before state: # ------------- # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 # Vrfcheck2 # Vrfcheck3 Eth1/3 # Eth1/14 # Eth1/16 # Eth1/17 # Vrfcheck4 Eth1/5 # Eth1/6 # - name: Configuring vrf deleted state dellemc.enterprise_sonic.sonic_vrfs: config: - name: Vrfcheck4 members: interfaces: - name: Eth1/6 - name: Vrfcheck3 members: interfaces: - name: Eth1/3 - name: Eth1/14 state: deleted # # After state: # ------------ # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 # Vrfcheck2 # Vrfcheck3 Eth1/16 # Eth1/17 # Vrfcheck4 Eth1/5 # # # Using "merged" state # # Before state: # ------------- # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 # Vrfcheck2 # Vrfcheck3 Eth1/16 # Eth1/17 # Vrfcheck4 # - name: Configuring vrf merged state dellemc.enterprise_sonic.sonic_vrfs: config: - name: Vrfcheck4 members: interfaces: - name: Eth1/5 - name: Eth1/6 - name: Vrfcheck3 members: interfaces: - name: Eth1/3 - name: Eth1/14 state: merged # # After state: # ------------ # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 # Vrfcheck2 # Vrfcheck3 Eth1/3 # Eth1/14 # Eth1/16 # Eth1/17 # Vrfcheck4 Eth1/5 # Eth1/6 # # Using "overridden" state # # Before state: # ------------- # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 # Vrfcheck2 # Vrfcheck3 Eth1/7 # Eth1/8 # - name: Overridden VRF configuration dellemc.enterprise_sonic.sonic_vrfs: sonic_vrfs: config: - name: Vrfcheck1 members: interfaces: - name: Eth1/3 - name: Eth1/14 - name: Vrfcheck3 members: interfaces: - name: Eth1/5 - name: Eth1/6 state: overridden # # After state: # ------------ # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 Eth1/3 # Eth1/14 # Vrfcheck2 # Vrfcheck3 Eth1/5 # Eth1/6 # # Using "replaced" state # # Before state: # ------------- # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 Eth1/3 # Vrfcheck2 # Vrfcheck3 Eth1/5 # Eth1/6 # - name: Replace VRF configuration dellemc.enterprise_sonic.sonic_vrfs: sonic_vrfs: config: - name: Vrfcheck1 members: interfaces: - name: Eth1/3 - name: Eth1/14 - name: Vrfcheck3 members: interfaces: - name: Eth1/5 - name: Eth1/6 state: replaced # # After state: # ------------ # # show ip vrf # VRF-NAME INTERFACES # ---------------------------------------------------------------- # Vrfcheck1 Eth1/3 # Eth1/14 # Vrfcheck2 # Vrfcheck3 Eth1/5 # Eth1/6 # 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 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 ~~~~~~~ - Abirami N (@abirami-n)