dellemc.enterprise_sonic.sonic_vxlans module – Manage VxLAN EVPN and its parameters

Note

This module is part of the dellemc.enterprise_sonic collection (version 3.0.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_vxlans.

New in dellemc.enterprise_sonic 1.0.0

Synopsis

  • Manages interface attributes of Enterprise SONiC interfaces.

Note

This module has a corresponding action plugin.

Parameters

Parameter

Comments

config

list / elements=dictionary

A list of VxLAN configurations.

evpn_nvo

string

EVPN nvo name

external_ip

string

added in dellemc.enterprise_sonic 2.5.0

The vtep mclag external ip address for this node

name

string / required

The name of the VxLAN.

primary_ip

string

The vtep mclag primary ip address for this node

source_ip

string

The source IP address of the VTEP.

suppress_vlan_neigh

list / elements=dictionary

added in dellemc.enterprise_sonic 3.1.0

list map of VLAN names with suppress on

vlan_name

string

name of VLAN

vlan_map

list / elements=dictionary

The list of VNI map of VLAN.

vlan

integer

VLAN ID for VNI VLAN map.

vni

integer / required

Specifies the VNI ID.

vrf_map

list / elements=dictionary

list of VNI map of VRF.

vni

integer / required

Specifies the VNI ID.

vrf

string

VRF name for VNI VRF map.

state

string

The state of the configuration after module completion.

Choices:

  • "merged" ← (default)

  • "deleted"

  • "replaced"

  • "overridden"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

# Using deleted
#
# Before state:
# -------------
#
# do show running-configuration
#
#interface vxlan vteptest1
# source-ip 1.1.1.1
# primary-ip 2.2.2.2
# map vni 101 vlan 11
# map vni 102 vlan 12
# map vni 101 vrf Vrfcheck1
# map vni 102 vrf Vrfcheck2
# suppress vlan-neigh vlan_name Vlan11
# suppress vlan-neigh vlan_name Vlan12
#!
#
- name: "Test vxlans deleted state 01"
  dellemc.enterprise_sonic.sonic_vxlans:
    config:
      - name: vteptest1
        source_ip: 1.1.1.1
        vlan_map:
          - vni: 101
            vlan: 11
        vrf_map:
          - vni: 101
            vrf: Vrfcheck1
        suppress_vlan_neigh:
          - vlan_name: Vlan11
          - vlan_name: Vlan12
    state: deleted
#
# After state:
# ------------
#
# do show running-configuration
#
#interface vxlan vteptest1
# source-ip 1.1.1.1
# map vni 102 vlan 12
# map vni 102 vrf Vrfcheck2
#!
#
# Using deleted
#
# Before state:
# -------------
#
# do show running-configuration
#
#interface vxlan vteptest1
# source-ip 1.1.1.1
# map vni 102 vlan 12
# map vni 102 vrf Vrfcheck2
#!
#
- name: "Test vxlans deleted state 02"
  dellemc.enterprise_sonic.sonic_vxlans:
    config:
    state: deleted
#
# After state:
# ------------
#
# do show running-configuration
#
#!
#
# Using merged
#
# Before state:
# -------------
#
# do show running-configuration
#
#!
#
- name: "Test vxlans merged state 01"
  dellemc.enterprise_sonic.sonic_vxlans:
    config:
      - name: vteptest1
        source_ip: 1.1.1.1
        primary_ip: 2.2.2.2
        evpn_nvo: nvo1
        vlan_map:
          - vni: 101
            vlan: 11
          - vni: 102
            vlan: 12
        vrf_map:
          - vni: 101
            vrf: Vrfcheck1
          - vni: 102
            vrf: Vrfcheck2
        suppress_vlan_neigh:
          - vlan_name: Vlan11
          - vlan_name: Vlan12
    state: merged
#
# After state:
# ------------
#
# do show running-configuration
#
#interface vxlan vteptest1
# source-ip 1.1.1.1
# primary-ip 2.2.2.2
# map vni 101 vlan 11
# map vni 102 vlan 12
# map vni 101 vrf Vrfcheck1
# map vni 102 vrf Vrfcheck2
# suppress vlan-neigh vlan-name Vlan11
# suppress vlan-neigh vlan-name Vlan12
#!
#
# Using overridden
#
# Before state:
# -------------
#
# do show running-configuration
#
#interface vxlan vteptest1
# source-ip 1.1.1.1
# primary-ip 2.2.2.2
# map vni 101 vlan 11
# map vni 102 vlan 12
# map vni 101 vrf Vrfcheck1
# map vni 102 vrf Vrfcheck2
#!
#
- name: "Test vxlans overridden state 01"
  dellemc.enterprise_sonic.sonic_vxlans:
    config:
      - name: vteptest2
        source_ip: 3.3.3.3
        primary_ip: 4.4.4.4
        evpn_nvo: nvo2
        vlan_map:
          - vni: 101
            vlan: 11
        vrf_map:
          - vni: 101
            vrf: Vrfcheck1
    state: overridden
#
# After state:
# ------------
#
# do show running-configuration
#
#interface vxlan vteptest2
# source-ip 3.3.3.3
# primary-ip 4.4.4.4
# map vni 101 vlan 11
# map vni 101 vrf Vrfcheck1
#!
#
# Using replaced
#
# Before state:
# -------------
#
# do show running-configuration
#
#interface vxlan vteptest2
# source-ip 3.3.3.3
# primary-ip 4.4.4.4
# map vni 101 vlan 11
# map vni 101 vrf Vrfcheck
#!
#
- name: "Test vxlans replaced state 01"
  dellemc.enterprise_sonic.sonic_vxlans:
    config:
      - name: vteptest2
        source_ip: 5.5.5.5
        vlan_map:
          - vni: 101
            vlan: 12
    state: replaced
#
# After state:
# ------------
#
# do show running-configuration
#
#interface vxlan vteptest2
# source-ip 5.5.5.5
# primary-ip 4.4.4.4
# map vni 101 vlan 12
# map vni 101 vrf Vrfcheck1
#!
#

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

list / elements=string

The resulting configuration module invocation.

Returned: when changed

Sample: ["The configuration returned is always in the same format as the parameters above.\n"]

before

list / elements=string

The configuration prior to the module invocation.

Returned: always

Sample: ["The configuration returned is always in the same format as the parameters above.\n"]

commands

list / elements=string

The set of commands that are pushed to the remote device.

Returned: always

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

Authors

  • Niraimadaiselvam M (@niraimadaiselvamm)