dellemc.enterprise_sonic.sonic_vxlans (2.4.0) — module

Manage VxLAN EVPN and its parameters

| "added in version" 1.0.0 of dellemc.enterprise_sonic"

Authors: Niraimadaiselvam M (@niraimadaiselvamm)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install dellemc.enterprise_sonic:==2.4.0


Add to requirements.yml

  collections:
    - name: dellemc.enterprise_sonic
      version: 2.4.0

Description

Manages interface attributes of Enterprise SONiC interfaces.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
#!
#
- 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
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#
# 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
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#
# 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
#!
#
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#
# 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

Inputs

    
state:
    choices:
    - merged
    - deleted
    - replaced
    - overridden
    default: merged
    description: The state of the configuration after module completion.
    type: str

config:
    description:
    - A list of VxLAN configurations.
    elements: dict
    suboptions:
      evpn_nvo:
        description: EVPN nvo name
        type: str
      name:
        description: The name of the VxLAN.
        required: true
        type: str
      primary_ip:
        description: The vtep mclag primary ip address for this node
        type: str
      source_ip:
        description: The source IP address of the VTEP.
        type: str
      vlan_map:
        description: The list of VNI map of VLAN.
        elements: dict
        suboptions:
          vlan:
            description: VLAN ID for VNI VLAN map.
            type: int
          vni:
            description: Specifies the VNI ID.
            required: true
            type: int
        type: list
      vrf_map:
        description: list of VNI map of VRF.
        elements: dict
        suboptions:
          vni:
            description: Specifies the VNI ID.
            required: true
            type: int
          vrf:
            description: VRF name for VNI VRF map.
            type: str
        type: list
    type: list

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: 'The configuration returned is always in the same format of the parameters
    above.

    '
  type: list
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: 'The configuration returned is always in the same format of the parameters
    above.

    '
  type: list
commands:
  description: The set of commands that are pushed to the remote device.
  returned: always
  sample:
  - command 1
  - command 2
  - command 3
  type: list