cisco.ios.ios_vxlan_vtep 模块 – 配置 VXLAN VTEP 接口的资源模块。

注意

此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install cisco.ios

要在 playbook 中使用它,请指定: cisco.ios.ios_vxlan_vtep

cisco.ios 5.3.0 中的新增功能

概要

  • 此模块提供对 Cisco IOS 网络设备上 VXLAN VTEP 接口的声明式管理。

别名:vxlan_vtep

参数

参数

注释

config

列表 / 元素=字典

VXLAN VTEP 接口选项的字典

host_reachability_bgp

布尔值

使用 EVPN 协议的主机可达性

选项

  • false

  • true

interface

字符串 / 必需

VXLAN VTEP 接口

member

字典

配置 VNI 成员

vni

字典

配置 VNI 信息

l2vni

列表 / 元素=字典

将 L2VNI 与 VXLAN VTEP 接口关联

replication

字典

L2VNI 的复制类型

mcast_group

字典

为 VNI(s) 配置多播组

ipv4

字符串

IPv4 多播组

ipv6

字符串

IPv6 多播组

type

字符串

复制类型

选项

  • "ingress"

  • "static"

vni

整数

VNI 编号

l3vni

列表 / 元素=字典

将 L3VNI 与 VXLAN VTEP 接口关联

vni

整数

VNI 编号

vrf

字符串

L3VNI 的 VRF 名称

source_interface

字符串

VXLAN VTEP 接口的源接口

running_config

字符串

此选项仅与状态 *parsed* 一起使用。

此选项的值应为通过执行命令 **show running-config | section ^interface nve** 从 IOS 设备接收的输出。

状态 *parsed* 从 running_config 选项读取配置并将其转换为 Ansible 结构化数据,该值然后在结果中的 *parsed* 键中返回。

state

字符串

配置应保留到的状态

选项

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "rendered"

  • "gathered"

  • "parsed"

备注

注意

示例

# Using state merged

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback1
#  host-reachability protocol bgp
#  member vni 10101 mcast-group 225.0.0.101
#  member vni 10102 ingress-replication
#  member vni 50901 vrf green
#  member vni 10201 mcast-group 225.0.0.101
#  member vni 10202 ingress-replication
#  member vni 50902 vrf blue

# - name: Merge the provided configuration with the device configuration
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#       source_interface: loopback2
#       member:
#         vni:
#           l2vni:
#             - vni: 10101
#               replication:
#                 type: ingress
#             - vni: 10201
#               replication:
#                 type: static
#                 mcast_group:
#                   ipv4: 225.0.0.101
#                   ipv6: FF0E:225::101
#           l3vni:
#             - vni: 50901
#               vrf: blue
#     state: merged

# Commands Fired:
# ---------------
#   "commands": [
#         "interface nve1",
#         "source-interface loopback2",
#         "no member vni 10101 mcast-group 225.0.0.101",
#         "member vni 10101 ingress-replication",
#         "no member vni 10201 mcast-group 225.0.0.101",
#         "member vni 10201 mcast-group 225.0.0.101 FF0E:225::101",
#         "no member vni 50901 vrf green",
#         "no member vni 50902 vrf blue",
#         "member vni 50901 vrf blue"
#   ],

# After state:
# ------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10102 ingress-replication
#  member vni 10202 ingress-replication
#  member vni 10101 ingress-replication
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101
#  member vni 50901 vrf blue

# Using state replaced

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10102 ingress-replication
#  member vni 10202 ingress-replication
#  member vni 10101 ingress-replication
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101
#  member vni 50901 vrf blue

# - name: Replaces the device configuration with the provided configuration
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#       source_interface: Loopback2
#       member:
#         vni:
#           l2vni:
#             - vni: 10101
#               replication:
#                 type: static
#                 mcast_group:
#                   ipv6: FF0E:225::101
#             - vni: 10201
#               replication:
#                 type: static
#                 mcast_group:
#                   ipv6: FF0E:225::102
#     state: replaced

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no member vni 10101 ingress-replication",
#       "member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10201 mcast-group 225.0.0.101 FF0E:225::101",
#       "member vni 10201 mcast-group FF0E:225::102",
#       "no member vni 10102 ingress-replication",
#       "no member vni 10202 ingress-replication",
#       "no member vni 50901 vrf blue"
#   ],

# After state:
# ------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10201 mcast-group FF0E:225::102

# Using state Deleted

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10201 mcast-group FF0E:225::102

# - name: "Delete VXLAN VTEP interface"
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#     state: deleted

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no source-interface Loopback2",
#       "no host-reachability protocol bgp",
#       "no member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10201 mcast-group FF0E:225::102"
#   ],

# After state:
# -------------
# interface nve1
#  no ip address

# Using state Deleted with member VNIs

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10102 mcast-group 225.0.0.101
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101

# - name: "Delete VXLAN VTEP interface with member VNIs"
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#       source_interface: Loopback2
#       member:
#         vni:
#           l2vni:
#             - vni: 10101
#             - vni: 10102
#     state: deleted

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10102 mcast-group 225.0.0.101"
#   ],

# After state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101

# Using state Deleted with no config

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10201 mcast-group FF0E:225::102

# - name: "Delete VXLAN VTEP interface with no config"
#   cisco.ios.ios_vxlan_vtep:
#     state: deleted

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no source-interface Loopback2",
#       "no host-reachability protocol bgp",
#       "no member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10201 mcast-group FF0E:225::102"
#   ],

# After state:
# -------------
# interface nve1
#  no ip address

返回值

常见的返回值已在此处记录 此处,以下是此模块特有的字段

描述

after

字典

模块执行后的最终配置。

返回:发生更改时

示例: "This output will always be in the same format as the module argspec.\n"

before

字典

模块执行之前的配置。

返回:当 *state* 为 mergedreplacedoverriddendeletedpurged

示例: "This output will always be in the same format as the module argspec.\n"

commands

列表 / 元素=字符串

推送到远程设备的命令集。

返回:当 *state* 为 mergedreplacedoverriddendeletedpurged

示例: ["interface nve1", "source-interface Loopback1", "host-reachability protocol bgp", "member vni 10101 ingress-replication"]

作者

  • Padmini Priyadarshini Sivaraj (@PadminiSivaraj)