cisco.ios.ios_evpn_global module – Resource module to configure L2VPN EVPN.

Note

This module is part of the cisco.ios collection (version 8.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 cisco.ios.

To use it in a playbook, specify: cisco.ios.ios_evpn_global.

New in cisco.ios 5.3.0

Synopsis

  • This module provides declarative management of L2VPN EVPN on Cisco IOS network devices.

Aliases: evpn_global

Parameters

Parameter

Comments

config

dictionary

A dictionary of L2VPN Ethernet Virtual Private Network (EVPN) configuration

default_gateway

dictionary

Default gateway parameters

advertise

boolean

Advertise Default Gateway MAC/IP routes

Choices:

  • false

  • true

flooding_suppression

dictionary

Suppress flooding of broadcast, multicast, and/or unknown unicast packets

address_resolution

dictionary

Suppress flooding of Address Resolution and Neighbor Discovery Protocol packets

disable

boolean

Disable flooding suppression

Choices:

  • false

  • true

ip

dictionary

IP parameters

local_learning

dictionary

IP local learning

disable

boolean

Disable IP local learning

Choices:

  • false

  • true

replication_type

string

Method for replicating BUM traffic

Choices:

  • "ingress"

  • "static"

route_target

dictionary

Route Target VPN Extended Communities

auto

dictionary

Automatically set a route-target

vni

boolean

Set vni-based route-target

Choices:

  • false

  • true

router_id

string

EVPN router ID

running_config

string

This option is used only with state parsed.

The value of this option should be the output received from the IOS device by executing the command sh running-config nve | section ^l2vpn evpn$.

The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module’s argspec and the value is then returned in the parsed key within the result.

state

string

The state the configuration should be left in

Choices:

  • "merged" ← (default)

  • "replaced"

  • "overridden"

  • "deleted"

  • "gathered"

  • "rendered"

  • "parsed"

Notes

Note

Examples

# Using merged

# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
#  replication-type static
#  router-id Loopback1
#  default-gateway advertise

- name: Merge provided configuration with device configuration
  cisco.ios.ios_evpn_global:
    config:
      replication_type: ingress
      route_target:
        auto:
          vni: true
      default_gateway:
        advertise: false
      ip:
        local_learning:
          disable: true
      flooding_suppression:
        address_resolution:
          disable: false
    state: merged

# Task Output
# -----------
#
# before:
# - replication_type: static
#   router_id: Loopback1
#   default_gateway:
#     advertise: true
# commands:
# - l2vpn evpn
#   no default-gateway advertise
#   replication-type ingress
#   route-target auto vni
#   ip local-learning disable
# after:
# - replication_type: ingress
#   router_id: Loopback1
#   route_target:
#     auto:
#       vni: true
#   ip:
#     local_learning:
#       disable: true

# After state:
# ------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
#  replication-type ingress
#  router-id Loopback1
#  ip local-learning disable
#  route-target auto vni

# Using replaced

# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
#  replication-type ingress
#  router-id Loopback1
#  ip local-learning disable
#  route-target auto vni

- name: Replaces device configuration for EVPN global with provided configuration
  cisco.ios.ios_evpn_global:
    config:
      replication_type: static
      router_id: Loopback2
      default_gateway:
        advertise: true
      flooding_suppression:
        address_resolution:
          disable: true
    state: replaced

# Task Output
# -----------
#
# before:
# - replication_type: ingress
#   router_id: Loopback1
#   route_target:
#     auto:
#       vni: true
#   ip:
#     local_learning:
#       disable: true
# commands:
# - l2vpn evpn
# - default-gateway advertise
# - flooding-suppression address-resolution disable
# - no ip local-learning disable
# - replication-type static
# - no route-target auto vni
# - router-id Loopback2
# after:
# - replication_type: ingress
#   router_id: Loopback2
#   default_gateway:
#     advertise: true
#   flooding_suppression:
#     address_resolution:
#      disable: true

# After state:
# ------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
#  replication-type static
#  flooding-suppression address-resolution disable
#  router-id Loopback2
#  default-gateway advertise

# Using Deleted

# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
#  replication-type static
#  flooding-suppression address-resolution disable
#  router-id Loopback2
#  default-gateway advertise

- name: Delete EVPN global
  cisco.ios.ios_evpn_global:
    config:
    state: deleted

# before:
# - replication_type: ingress
#   router_id: Loopback2
#   default_gateway:
#     advertise: true
#   flooding_suppression:
#     address_resolution:
#      disable: true
# commands:
# - no l2vpn evpn
# after:
#

# After state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
#

# Using gathered

# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
#  replication-type ingress
#  router-id Loopback1
#  ip local-learning disable
#  route-target auto vni

- name: Gather facts of l2vpn evpn
  cisco.ios.ios_evpn_global:
    config:
    state: gathered

# Task Output:
# ------------
#
# gathered:
# - replication_type: ingress
#   route_target:
#     auto:
#       vni: true
#   router_id: Loopback1
#   ip:
#     local_learning:
#       disable: true

# Using rendered

- name: Render the commands for provided configuration
  cisco.ios.ios_evpn_global:
    config:
      replication_type: static
      route_target:
        auto:
          vni: true
    state: rendered

# Task Output:
# ------------
#
# rendered:
# - l2vpn evpn
# - replication-type static
# - route-target auto vni

# Using parsed

# File: parsed.cfg
# ----------------
#
# l2vpn evpn
#  replication-type ingress
#  router-id Loopback1
#  default-gateway advertise
#  route-target auto vni

- name: Parse the provided configuration
  cisco.ios.ios_evpn_global:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Task Output:
# ------------
#
# parsed:
# - replication_type: ingress
#   route_target:
#     auto:
#       vni: true
#   router_id: Loopback1
#   default_gateway:
#     advertise: true

Return Values

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

Key

Description

after

dictionary

The resulting configuration after module execution.

Returned: when changed

Sample: "This output will always be in the same format as the module argspec.\n"

before

dictionary

The configuration prior to the module execution.

Returned: when state is merged, replaced, overridden, or deleted

Sample: "This output will always be in the same format as the module argspec.\n"

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: when state is merged, replaced, overridden, or deleted

Sample: ["l2vpn evpn", "replication-type ingress", "router_id Loopback1"]

gathered

list / elements=string

Facts about the network resource gathered from the remote device as structured data.

Returned: when state is gathered

Sample: ["This output will always be in the same format as the module argspec.\n"]

parsed

list / elements=string

The device native config provided in running_config option parsed into structured data as per module argspec.

Returned: when state is parsed

Sample: ["This output will always be in the same format as the module argspec.\n"]

rendered

list / elements=string

The provided configuration in the task rendered in device-native format (offline).

Returned: when state is rendered

Sample: ["l2vpn evpn", "replication-type static", "route-target auto vni"]

Authors

  • Padmini Priyadarshini Sivaraj (@PadminiSivaraj)