On this page
dellemc.enterprise_sonic.sonic_vrfs – Manage VRFs and associate VRFs to interfaces such as, Eth, LAG, VLAN, and loopback
Note
This plugin is part of the dellemc.enterprise_sonic collection (version 1.1.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_vrfs.
New in version 1.0.0: of dellemc.enterprise_sonic
Synopsis
- Manages VRF and VRF interface attributes in Enterprise SONiC Distribution by Dell Technologies.
 
Note
This module has a corresponding action plugin.
Parameters
| 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
         | 
      
       
  | 
      
        
        The state of the configuration after module completion.
         | 
     |||
Notes
Note
- Tested against Enterprise SONiC Distribution by Dell Technologies.
 - Supports 
check_mode. 
Examples
# Using deleted
#
# 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
#
# 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
#
  Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | 
|---|---|---|
| after
        
        list / elements=string
         | 
      when changed | 
        
        The resulting configuration model invocation.
         Sample:
        
       
        The configuration returned is always in the same format of the parameters above.
         | 
     
| before
        
        list / elements=string
         | 
      always | 
        
        The configuration prior to the model invocation.
         Sample:
        
       
        The configuration returned is always in the same format of the parameters above.
         | 
     
| commands
        
        list / elements=string
         | 
      always | 
        
        The set of commands pushed to the remote device.
         Sample:
        
       
        ['command 1', 'command 2', 'command 3']
         | 
     
Authors
- Abirami N (@abirami-n)
 
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
 https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_vrfs_module.html