.. _cisco.ios.ios_evpn_ethernet_module: *************************** cisco.ios.ios_evpn_ethernet *************************** **Resource module to configure L2VPN EVPN Ethernet Segment.** Version added: 9.2.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module manages the L2VPN EVPN Ethernet Segment attributes of Cisco IOS network devices. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A dictionary of L2VPN EVPN Ethernet Segment options
default
boolean
    Choices:
  • no
  • yes
Set a command to its defaults
df_election
dictionary
Designated forwarder election parameters
preempt_time
integer
Preempt time before advertising routes
wait_time
integer
Designated forwarder election wait time
identifier
dictionary
Ethernet Segment Identifiers
esi_value
string
system mac or 9-octet ESI value in hex
identifier_type
string
    Choices:
  • 0
  • 3
Type 0 (arbitrary 9-octet ESI value)
Type 3 (MAC-based ESI value)
redundancy
dictionary
Multi-homing redundancy parameters
all_active
boolean
    Choices:
  • no
  • yes
Per-flow load-balancing between PEs on same Ethernet Segment
single_active
boolean
    Choices:
  • no
  • yes
Per-vlan load-balancing between PEs on same Ethernet Segment
segment
string / required
L2VPN EVPN Ethernet Segment, l2vpn evpn ethernet-segment 1
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 show running-config | section ^l2vpn.
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
  • rendered
  • gathered
  • purged
  • parsed
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 config option to platform specific CLI commands which will be returned in the rendered key within the result. For state rendered active connection to remote host is not required.
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 running_config option and transforms it into JSON format as per the resource module parameters and the value is returned in the parsed key within the result. The value of running_config option should be the same format as the output of command show running-config | section ^l2vpn executed on device. For state parsed active connection to remote host is not required.
The state purged negates virtual/logical interfaces that are specified in task from running-config.

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.html - The module examples uses callback plugin (callback_result_format=yaml) to generate task output in yaml format. Examples -------- .. code-block:: yaml # 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: .. raw:: html
Key Returned Description
after
list
when changed
The resulting configuration after module execution.

Sample:
This output will always be in the same format as the module argspec.
before
list
when state is merged, replaced, overridden, deleted or purged
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, deleted or purged
The set of commands pushed to the remote device.

Sample:
['l2vpn evpn ethernet-segment 1', 'identifier type 0 00.00.00.00.00.00.00.00.01', 'redundancy single-active']
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 ethernet-segment 1', 'identifier type 3 system-mac 0000.0000.0000.0001', 'redundancy all-active']


Status ------ Authors ~~~~~~~ - Sagar Paul (@KB-perByte) - Jorgen Spange (@jorgenspange)