cisco / cisco.ios / 8.0.0 / module / ios_evpn_global Resource module to configure L2VPN EVPN. | "added in version" 5.3.0 of cisco.ios" Authors: Padmini Priyadarshini Sivaraj (@PadminiSivaraj)cisco.ios.ios_evpn_global (8.0.0) — module
Install with ansible-galaxy collection install cisco.ios:==8.0.0
collections: - name: cisco.ios version: 8.0.0
This module provides declarative management of L2VPN EVPN on Cisco IOS network devices.
# 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
state: choices: - merged - replaced - overridden - deleted - gathered - rendered - parsed default: merged description: - The state the configuration should be left in type: str config: description: A dictionary of L2VPN Ethernet Virtual Private Network (EVPN) configuration suboptions: default_gateway: description: Default gateway parameters suboptions: advertise: description: Advertise Default Gateway MAC/IP routes type: bool type: dict flooding_suppression: description: Suppress flooding of broadcast, multicast, and/or unknown unicast packets suboptions: address_resolution: description: Suppress flooding of Address Resolution and Neighbor Discovery Protocol packets suboptions: disable: description: Disable flooding suppression type: bool type: dict type: dict ip: description: IP parameters suboptions: local_learning: description: IP local learning suboptions: disable: description: Disable IP local learning type: bool type: dict type: dict replication_type: choices: - ingress - static description: Method for replicating BUM traffic type: str route_target: description: Route Target VPN Extended Communities suboptions: auto: description: Automatically set a route-target suboptions: vni: description: Set vni-based route-target type: bool type: dict type: dict router_id: description: EVPN router ID type: str type: dict running_config: description: - This option is used only with state I(parsed). - The value of this option should be the output received from the IOS device by executing the command B(sh running-config nve | section ^l2vpn evpn$). - The state I(parsed) reads the configuration from C(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 I(parsed) key within the result. type: str
after: description: The resulting configuration after module execution. returned: when changed sample: 'This output will always be in the same format as the module argspec. ' type: dict before: description: The configuration prior to the module execution. returned: when I(state) is C(merged), C(replaced), C(overridden), or C(deleted) sample: 'This output will always be in the same format as the module argspec. ' type: dict commands: description: The set of commands pushed to the remote device. returned: when I(state) is C(merged), C(replaced), C(overridden), or C(deleted) sample: - l2vpn evpn - replication-type ingress - router_id Loopback1 type: list gathered: description: Facts about the network resource gathered from the remote device as structured data. returned: when I(state) is C(gathered) sample: 'This output will always be in the same format as the module argspec. ' type: list parsed: description: The device native config provided in I(running_config) option parsed into structured data as per module argspec. returned: when I(state) is C(parsed) sample: 'This output will always be in the same format as the module argspec. ' type: list rendered: description: The provided configuration in the task rendered in device-native format (offline). returned: when I(state) is C(rendered) sample: - l2vpn evpn - replication-type static - route-target auto vni type: list