cisco.ios.ios_evpn_ethernet module – Resource module to configure L2VPN EVPN Ethernet Segment.
Note
This module is part of the cisco.ios collection (version 10.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_ethernet
.
New in cisco.ios 9.2.0
Synopsis
This module manages the L2VPN EVPN Ethernet Segment attributes of Cisco IOS network devices.
Parameters
Parameter |
Comments |
---|---|
A dictionary of L2VPN EVPN Ethernet Segment options |
|
Set a command to its defaults Choices:
|
|
Designated forwarder election parameters |
|
Preempt time before advertising routes |
|
Designated forwarder election wait time |
|
Ethernet Segment Identifiers |
|
system mac or 9-octet ESI value in hex |
|
Type 0 (arbitrary 9-octet ESI value) Type 3 (MAC-based ESI value) Choices:
|
|
Multi-homing redundancy parameters |
|
Per-flow load-balancing between PEs on same Ethernet Segment Choices:
|
|
Per-vlan load-balancing between PEs on same Ethernet Segment Choices:
|
|
L2VPN EVPN Ethernet Segment, l2vpn evpn ethernet-segment 1 |
|
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 show running-config | section ^l2vpn. The state parsed reads the configuration from |
|
The state the configuration should be left in The states rendered, gathered and parsed does not perform any change on the device. The state rendered will transform the configuration in The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result. The state parsed reads the configuration from The state purged negates virtual/logical interfaces that are specified in task from running-config. Choices:
|
Notes
Note
Tested against Cisco IOSXE Version 17.16.
This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.htmlThe module examples uses callback plugin (callback_result_format=yaml) to generate task output in yaml format.
Examples
# Using merged
# Before state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Gather facts of evpn ethernet segment
cisco.ios.ios_evpn_ethernet:
config:
- identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.01
redundancy:
single_active: true
segment: '1'
- df_election:
preempt_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.02
redundancy:
single_active: true
segment: '2'
- identifier:
identifier_type: '3'
esi_value: 00.00.00.00.00.00.00.00.03
redundancy:
single_active: true
segment: '3'
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.04
redundancy:
all_active: true
segment: '4'
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.05
redundancy:
all_active: true
segment: '5'
state: merged
# Task Output
# -----------
#
# before:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# commands:
# - l2vpn evpn ethernet-segment 5
# - identifier type 0 00.00.00.00.00.00.00.00.05
# - redundancy all-active
# - df-election wait-time 1
# after:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.05
# redundancy:
# all_active: true
# segment: '5'
# After state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
# l2vpn evpn ethernet-segment 5
# identifier type 0 00.00.00.00.00.00.00.00.05
# redundancy all-active
# df-election wait-time 1
# !
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Gather facts of evpn ethernet segment
cisco.ios.ios_evpn_ethernet:
config:
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.04
redundancy:
single_active: true
segment: '4'
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.05
redundancy:
all_active: true
segment: '5'
state: replaced
# Task Output
# -----------
#
# before:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# commands:
# - l2vpn evpn ethernet-segment 4
# - redundancy single-active
# - l2vpn evpn ethernet-segment 5
# - identifier type 0 00.00.00.00.00.00.00.00.05
# - redundancy all-active
# - df-election wait-time 1
# after:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# single_active: true
# segment: '4'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.05
# redundancy:
# all_active: true
# segment: '5'
# After state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy single-active
# df-election wait-time 1
# !
# l2vpn evpn ethernet-segment 5
# identifier type 0 00.00.00.00.00.00.00.00.05
# redundancy all-active
# df-election wait-time 1
# !
# Using overridden
# Before state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Gather facts of evpn ethernet segment
cisco.ios.ios_evpn_ethernet:
config:
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.04
redundancy:
single_active: true
segment: '4'
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.05
redundancy:
all_active: true
segment: '5'
state: overridden
# After state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy single-active
# df-election wait-time 1
# !
# l2vpn evpn ethernet-segment 5
# identifier type 0 00.00.00.00.00.00.00.00.05
# redundancy all-active
# df-election wait-time 1
# !
# Using deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Gather facts of evpn ethernet segment
cisco.ios.ios_evpn_ethernet:
config:
- identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.01
redundancy:
single_active: true
segment: '1'
- df_election:
preempt_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.02
redundancy:
single_active: true
segment: '2'
state: deleted
# Task Output
# -----------
#
# before:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# commands:
# - l2vpn evpn ethernet-segment 1
# - no identifier type 0 00.00.00.00.00.00.00.00.01
# - no redundancy single-active
# - l2vpn evpn ethernet-segment 2
# - no identifier type 0 00.00.00.00.00.00.00.00.02
# - no redundancy single-active
# - no df-election wait-time 1
# after:
# - segment: '1'
# - segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.05
# redundancy:
# all_active: true
# segment: '5'
# After state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# !
# l2vpn evpn ethernet-segment 2
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
# l2vpn evpn ethernet-segment 5
# identifier type 0 00.00.00.00.00.00.00.00.05
# redundancy all-active
# df-election wait-time 1
# !
# Using purged
# Before state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Gather facts of evpn ethernet segment
cisco.ios.ios_evpn_ethernet:
config:
- segment: '1'
- segment: '2'
state: purged
# Task Output
# -----------
#
# before:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# commands:
# - no l2vpn evpn ethernet-segment 1
# - no l2vpn evpn ethernet-segment 2
# after:
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.05
# redundancy:
# all_active: true
# segment: '5'
# After state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
# l2vpn evpn ethernet-segment 5
# identifier type 0 00.00.00.00.00.00.00.00.05
# redundancy all-active
# df-election wait-time 1
# !
# Using gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^l2vpn evpn ethernet-segment
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Gather facts of evpn ethernet segment
cisco.ios.ios_evpn_ethernet:
config:
state: gathered
# Task Output
# -----------
#
# gathered:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
# Using rendered
- name: Render commands with provided configuration
cisco.ios.ios_evpn_ethernet:
config:
- identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.01
redundancy:
single_active: true
segment: '1'
- df_election:
preempt_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.02
redundancy:
single_active: true
segment: '2'
- identifier:
identifier_type: '3'
esi_value: 00.00.00.00.00.00.00.00.03
redundancy:
single_active: true
segment: '3'
- df_election:
wait_time: 1
identifier:
identifier_type: '0'
esi_value: 00.00.00.00.00.00.00.00.04
redundancy:
all_active: true
segment: '4'
state: rendered
# Task Output
# -----------
#
# rendered:
# - l2vpn evpn ethernet-segment 1
# - redundancy single-active
# - identifier type 0 00.00.00.00.00.00.00.00.01
# - l2vpn evpn ethernet-segment 2
# - df-election preempt-time 1
# - redundancy single-active
# - identifier type 0 00.00.00.00.00.00.00.00.02
# - l2vpn evpn ethernet-segment 3
# - redundancy single-active
# - identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# - l2vpn evpn ethernet-segment 4
# - df-election wait-time 1
# - redundancy all-active
# - identifier type 0 00.00.00.00.00.00.00.00.04
# Using parsed
# File: parsed.cfg
# ----------------
#
# l2vpn evpn ethernet-segment 1
# identifier type 0 00.00.00.00.00.00.00.00.01
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 2
# identifier type 0 00.00.00.00.00.00.00.00.02
# redundancy single-active
# df-election preempt-time 1
# !
# l2vpn evpn ethernet-segment 3
# identifier type 3 system-mac 00.00.00.00.00.00.00.00.03
# redundancy single-active
# !
# l2vpn evpn ethernet-segment 4
# identifier type 0 00.00.00.00.00.00.00.00.04
# redundancy all-active
# df-election wait-time 1
# !
- name: Parse the provided configuration
cisco.ios.ios_evpn_ethernet:
running_config: "{{ lookup('file', 'ios_ethernet_segment_parsed.cfg') }}"
state: parsed
# Task Output
# -----------
#
# parsed:
# - identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.01
# redundancy:
# single_active: true
# segment: '1'
# - df_election:
# preempt_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.02
# redundancy:
# single_active: true
# segment: '2'
# - identifier:
# identifier_type: '3'
# esi_value: 00.00.00.00.00.00.00.00.03
# redundancy:
# single_active: true
# segment: '3'
# - df_election:
# wait_time: 1
# identifier:
# identifier_type: '0'
# esi_value: 00.00.00.00.00.00.00.00.04
# redundancy:
# all_active: true
# segment: '4'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration after module execution. Returned: when changed Sample: |
|
The configuration prior to the module execution. Returned: when state is Sample: |
|
The set of commands pushed to the remote device. Returned: when state is Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: |