Resource module to configure L2VPN EVPN.
Version added: 5.3.0
- This module provides declarative management of L2VPN EVPN on Cisco IOS network devices.
Note
- Tested against Cisco IOS-XE device with Version 17.13.01 on Cat9k on CML.
- This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
# 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
Common return values are documented here, the following are the fields unique to this module:
- Padmini Priyadarshini Sivaraj (@PadminiSivaraj)