cisco.ios.ios_evpn_global 模块 – 用于配置 L2VPN EVPN 的资源模块。
注意
此模块是 cisco.ios 集合(版本 9.0.3)的一部分。
如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install cisco.ios。
要在 playbook 中使用它,请指定:cisco.ios.ios_evpn_global。
cisco.ios 5.3.0 中的新增功能
概要
- 此模块提供 Cisco IOS 网络设备上 L2VPN EVPN 的声明式管理。 
别名:evpn_global
参数
| 参数 | 注释 | 
|---|---|
| L2VPN 以太网虚拟专用网络 (EVPN) 配置的字典 | |
| 默认网关参数 | |
| 通告默认网关 MAC/IP 路由 选项 
 | |
| 抑制广播、组播和/或未知单播数据包的洪泛 | |
| 抑制地址解析和邻居发现协议数据包的洪泛 | |
| 禁用洪泛抑制 选项 
 | |
| IP 参数 | |
| IP 本地学习 | |
| 禁用 IP 本地学习 选项 
 | |
| 复制 BUM 流量的方法 选项 
 | |
| 路由目标 VPN 扩展社区 | |
| 自动设置路由目标 | |
| 设置基于 vni 的路由目标 选项 
 | |
| EVPN 路由器 ID | |
| 此选项仅与状态 parsed 一起使用。 此选项的值应是从 IOS 设备执行命令 **sh running-config nve | section ^l2vpn evpn$** 收到的输出。 状态 parsed 从  | |
| 配置应保留的状态 选项 
 | 
说明
注意
- 在 CML 上使用 Cat9k 上的 17.13.01 版本针对 Cisco IOS-XE 设备进行了测试。 
- 此模块使用连接 - network_cli。请参阅 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
示例
# 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
返回值
常见的返回值在此处记录 这里,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 模块执行后的结果配置。 返回: 当更改时 示例:  | |
| 模块执行前的配置。 返回: 当 state 为  示例:  | |
| 推送到远程设备的命令集。 返回: 当 state 为  示例:  | |
| 从远程设备收集的关于网络资源的事实,以结构化数据的形式。 返回: 当 state 为  示例:  | |
| 在 running_config 选项中提供的设备原生配置按照模块 argspec 解析为结构化数据。 返回: 当 state 为  示例:  | |
| 任务中提供的配置以设备原生格式呈现(离线)。 返回: 当 state 为  示例:  | 
