Skip to content

Latest commit

 

History

History
721 lines (656 loc) · 25.7 KB

cisco.ios.ios_evpn_global_module.rst

File metadata and controls

721 lines (656 loc) · 25.7 KB

cisco.ios.ios_evpn_global

Resource module to configure L2VPN EVPN.

Version added: 5.3.0

  • This module provides declarative management of L2VPN EVPN on Cisco IOS network devices.
Parameter Choices/Defaults Comments
config
dictionary
A dictionary of L2VPN Ethernet Virtual Private Network (EVPN) configuration
default_gateway
dictionary
Default gateway parameters
advertise
boolean
    Choices:
  • no
  • yes
Advertise Default Gateway MAC/IP routes
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
    Choices:
  • no
  • yes
Disable flooding suppression
ip
dictionary
IP parameters
local_learning
dictionary
IP local learning
disable
boolean
    Choices:
  • no
  • yes
Disable IP local learning
replication_type
string
    Choices:
  • ingress
  • static
Method for replicating BUM traffic
route_target
dictionary
Route Target VPN Extended Communities
auto
dictionary
Automatically set a route-target
vni
boolean
    Choices:
  • no
  • yes
Set vni-based route-target
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
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
  • rendered
  • parsed
The state the configuration should be left in

Note

# 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:

Key Returned Description
after
dictionary
when changed
The resulting configuration after module execution.

Sample:
This output will always be in the same format as the module argspec.
before
dictionary
when state is merged, replaced, overridden, or deleted
The configuration prior to the module execution.

Sample:
This output will always be in the same format as the module argspec.
commands
list
when state is merged, replaced, overridden, or deleted
The set of commands pushed to the remote device.

Sample:
['l2vpn evpn', 'replication-type ingress', 'router_id Loopback1']
gathered
list
when state is gathered
Facts about the network resource gathered from the remote device as structured data.

Sample:
This output will always be in the same format as the module argspec.
parsed
list
when state is parsed
The device native config provided in running_config option parsed into structured data as per module argspec.

Sample:
This output will always be in the same format as the module argspec.
rendered
list
when state is rendered
The provided configuration in the task rendered in device-native format (offline).

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


Authors

  • Padmini Priyadarshini Sivaraj (@PadminiSivaraj)