cisco.ios.ios_evpn_evi 模块 – 配置 L2VPN EVPN EVI 的资源模块。
注意
此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install cisco.ios。
要在 playbook 中使用它,请指定:cisco.ios.ios_evpn_evi。
cisco.ios 5.3.0 中的新增功能
概要
- 此模块提供对 Cisco IOS 网络设备上 L2VPN EVPN EVI 的声明式管理。 
别名:evpn_evi
参数
| 参数 | 注释 | 
|---|---|
| L2VPN 以太网虚拟专用网络 (EVPN) EVI 配置的字典 | |
| 默认网关参数 | |
| 通告默认网关 MAC/IP 路由 | |
| 禁用默认网关 MAC/IP 路由的通告 选项 
 | |
| 启用默认网关 MAC/IP 路由的通告 选项 
 | |
| EVPN 封装类型 选项 
 | |
| EVPN 实例值 | |
| IP 参数 | |
| IP 本地学习 | |
| 禁用 IP 本地学习 选项 
 | |
| 启用 IP 本地学习 选项 
 | |
| 复制 BUM 流量的 方法 选项 
 | |
| EVPN 路由区分符 | |
| 此选项仅在 state 为 *parsed* 时使用。 此选项的值应为通过执行命令 **sh running-config nve | section ^l2vpn evpn$** 从 IOS 设备接收到的输出。 state 为 *parsed* 将从  | |
| 配置应保留的状态 选项 
 | 
备注
注意
- 在具有 Cat9k 上 CML 版本 17.13.01 的 Cisco IOS-XE 设备上进行了测试。 
- 此模块与连接 - network_cli兼容。请参阅 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
示例
# Using state merged
# Before state:
# -------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# l2vpn evpn instance 201 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# - name: Merge provided configuration with device configuration
#   cisco.ios.ios_evpn_evi:
#     config:
#       - evi: 101
#         replication_type: ingress
#         route_distinguisher: '1:1'
#         default_gateway:
#           advertise:
#             enable: False
#         ip:
#           local_learning:
#             enable: True
#
#       - evi: 202
#         replication_type: static
#         default_gateway:
#           advertise:
#             enable: True
#         ip:
#           local_learning:
#             disable: True
#     state: merged
# Commands Fired:
# ---------------
# "commands": [
#     "l2vpn evpn instance 101 vlan-based",
#     "ip local-learning enable",
#     "replication-type ingress",
#     "rd 1:1",
#     "l2vpn evpn instance 202 vlan-based",
#     "default-gateway advertise enable",
#     "ip local-learning disable",
#     "replication-type static"
#     ],
# After state:
# ------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  rd 1:1
#  replication-type ingress
#  ip local-learning enable
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# l2vpn evpn instance 201 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type static
#  ip local-learning disable
#  default-gateway advertise enable
# Using state replaced
# Before state:
# -------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  rd 1:1
#  replication-type ingress
#  ip local-learning enable
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# l2vpn evpn instance 201 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type static
#  ip local-learning disable
#  default-gateway advertise enable
# - name: Replaces the device configuration with the provided configuration
#   cisco.ios.ios_evpn_evi:
#     config:
#       - evi: 101
#         replication_type: ingress
#         default_gateway:
#           advertise:
#             enable: True
#       - evi: 202
#         replication_type: ingress
#     state: replaced
# Commands Fired:
# ---------------
# "commands": [
#     "l2vpn evpn instance 101 vlan-based",
#     "default-gateway advertise enable",
#     "no ip local-learning enable",
#     "no rd 1:1",
#     "l2vpn evpn instance 202 vlan-based",
#     "no default-gateway advertise enable",
#     "no ip local-learning disable",
#     "replication-type ingress"
#     ],
# After state:
# ------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type ingress
#  default-gateway advertise enable
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# l2vpn evpn instance 201 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# Using state overridden
# Before state:
# -------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type ingress
#  default-gateway advertise enable
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# l2vpn evpn instance 201 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# - name: Override the device configuration with provided configuration
#   cisco.ios.ios_evpn_evi:
#     config:
#       - evi: 101
#         replication_type: ingress
#         default_gateway:
#           advertise:
#             enable: True
#       - evi: 202
#         replication_type: static
#         default_gateway:
#           advertise:
#             enable: True
#     state: overridden
# Commands Fired:
# ---------------
# "commands": [
#     "no l2vpn evpn instance 102 vlan-based",
#     "no l2vpn evpn instance 201 vlan-based",
#     "l2vpn evpn instance 202 vlan-based",
#     "default-gateway advertise enable",
#     "replication-type static"
#     ],
# After state:
# ------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type ingress
#  default-gateway advertise enable
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type static
#  default-gateway advertise enable
# Using state Deleted
# Before state:
# -------------
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type ingress
#  default-gateway advertise enable
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type static
#  default-gateway advertise enable
# - name: "Delete the given EVI(s)"
#   cisco.ios.ios_evpn_evi:
#     config:
#       - evi: 101
#     state: deleted
# Commands Fired:
# ---------------
# "commands": [
#       "no l2vpn evpn instance 101 vlan-based"
#       ],
# After state:
# -------------
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type static
#  default-gateway advertise enable
# Using state Deleted without any config passed
# Before state:
# -------------
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type static
#  default-gateway advertise enable
# - name: "Delete ALL EVIs"
#   cisco.ios.ios_evpn_evi:
#     state: deleted
# Commands Fired:
# ---------------
# "commands": [
#     "no l2vpn evpn instance 102 vlan-based",
#     "no l2vpn evpn instance 202 vlan-based"
#     ],
# After state:
# -------------
# !
# Using gathered
# Before state:
# -------------
#
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# l2vpn evpn instance 201 vlan-based
#  encapsulation vxlan
#  replication-type static
# !
# l2vpn evpn instance 202 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# - name: Gather facts for evpn_evi
#   cisco.ios.ios_evpn_evi:
#     config:
#     state: gathered
# Task Output:
# ------------
#
# gathered:
#   - evi: 101
#     encapsulation: vxlan
#     replication_type: static
#   - evi: 102
#     encapsulation: vxlan
#     replication_type: ingress
#   - evi: 201
#     encapsulation: vxlan
#     replication_type: static
#   - evi: 202
#     encapsulation: vxlan
#     replication_type: ingress
# Using Rendered
# - name: Rendered the provided configuration with the existing running configuration
#   cisco.ios.ios_evpn_evi:
#     config:
#       - evi: 101
#         replication_type: ingress
#         default_gateway:
#           advertise:
#             enable: True
#       - evi: 202
#         replication_type: ingress
#     state: rendered
# Task Output:
# ------------
#
# rendered:
# - l2vpn evpn instance 101 vlan-based
# - default-gateway advertise enable
# - replication-type ingress
# - l2vpn evpn instance 202 vlan-based
# - replication-type ingress
# Using parsed
# File: parsed.cfg
# ----------------
#
# l2vpn evpn instance 101 vlan-based
#  encapsulation vxlan
#  replication-type ingress
#  default-gateway advertise enable
# !
# l2vpn evpn instance 102 vlan-based
#  encapsulation vxlan
#  replication-type ingress
# !
# - name: Parse the commands for provided configuration
#   cisco.ios.ios_evpn_evi:
#     running_config: "{{ lookup('file', 'parsed.cfg') }}"
#     state: parsed
# Task Output:
# ------------
#
# parsed:
#   - evi: 101
#     encapsulation: vxlan
#     replication_type: ingress
#     default_gateway:
#       advertise:
#         enable: true
#   - evi: 102
#     encapsulation: vxlan
#     replication_type: ingress
返回值
常用返回值已在此处记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 模块执行后的结果配置。 返回:发生更改时 示例: | |
| 模块执行之前的配置。 返回:当 state 为  示例: | |
| 推送到远程设备的命令集。 返回:当 state 为  示例: | 
