cisco.ios.ios_route_maps 模块 – 用于配置路由映射的资源模块。

注意

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

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

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

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

cisco.ios 2.1.0 中的新增功能

概要

  • 此模块配置和管理 Cisco IOS 上路由映射的属性。

参数

参数

注释

config

列表 / elements=字典

路由映射的配置列表。

entries

列表 / elements=字典

路由映射的配置条目列表。

action

字符串

路由映射设置操作

选择

  • "拒绝"

  • "允许"

continue_entry

字典

在路由映射中继续执行不同的条目

entry_sequence

整数

路由映射条目序列号

请参阅供应商文档以获取有效值

set

布尔值

设置继续

选择

  • false

  • true

description

字符串

路由映射注释

match

字典

匹配路由表中的值

additional_paths

字典

BGP Add-Path 匹配策略

BGP Add-Path 广告集策略

all

布尔值

BGP Add-Path 广告所有路径

选择

  • false

  • true

best

整数

BGP Add-Path 广告最佳 n 条路径 (1-3)

best_range

字典

BGP Add-Path 广告最佳路径(范围 m 到 n)

lower_limit

整数

BGP Add-Path 要广告的最佳路径(下限)(1-3)

upper_limit

整数

BGP Add-Path 要广告的最佳路径(上限)(1-3)

group_best

布尔值

BGP Add-Path 广告组最佳路径

选择

  • false

  • true

as_path

字典

匹配 BGP AS 路径列表

acls

列表 / elements=整数

AS 路径访问列表

请参阅供应商文档以获取有效值

set

布尔值

设置 AS 路径列表

选择

  • false

  • true

clns

字典

CLNS 信息

address

字符串

匹配路由地址或匹配数据包

next_hop

字符串

匹配路由的下一跳地址

route_source

字符串

匹配路由的广告源地址

community

字典

匹配 BGP 社区列表

exact_match

布尔值

执行社区的精确匹配

选择

  • false

  • true

name

列表 / elements=字符串

社区列表编号/社区列表名称

请参阅供应商文档以获取有效值

extcommunity

列表 / elements=字符串

匹配 BGP/VPN 扩展社区列表

扩展社区列表编号

请参阅供应商文档以获取有效值

interfaces

列表 / elements=字符串

匹配路由的第一跳接口

ip

字典

IP 特定信息

address

字典

匹配路由地址或匹配数据包

acls

列表 / elements=字符串

匹配 ACL 的条目

IP ACL 名称/编号

请参阅供应商文档以获取有效值

prefix_lists

列表 / elements=字符串

匹配前缀列表的条目

IP 前缀列表名称

flowspec

字典

匹配流规范前缀的源/目标前缀组件

acls

列表 / elements=字符串

匹配 ACL 的条目

IP ACL 名称/编号

请参阅供应商文档以获取有效值

dest_pfx

布尔值

匹配流规范前缀的目标前缀组件

选择

  • false

  • true

prefix_lists

列表 / elements=字符串

匹配前缀列表的条目

IP 前缀列表名称

src_pfx

布尔值

匹配流规范前缀的源前缀组件

选择

  • false

  • true

next_hop

字典

匹配路由的下一跳地址

acls

列表 / elements=字符串

匹配 ACL 的条目

IP ACL 名称/编号

请参阅供应商文档以获取有效值

prefix_lists

列表 / elements=字符串

匹配前缀列表的条目

IP 前缀列表名称

set

布尔值

设置下一跳地址

选择

  • false

  • true

redistribution_source

字典

路由重分发源(仅限 EIGRP)

acls

列表 / elements=字符串

匹配 ACL 的条目

IP ACL 名称/编号

请参阅供应商文档以获取有效值

prefix_lists

列表 / elements=字符串

匹配前缀列表的条目

IP 前缀列表名称

set

布尔值

设置重分发源

选择

  • false

  • true

route_source

字典

匹配路由的广告源地址

acls

列表 / elements=字符串

匹配 ACL 的条目

IP ACL 名称/编号

请参阅供应商文档以获取有效值

prefix_lists

列表 / elements=字符串

匹配前缀列表的条目

IP 前缀列表名称

redistribution_source

布尔值

路由重分发源(仅限 EIGRP)

选择

  • false

  • true

set

布尔值

设置重分发源

选择

  • false

  • true

ipv6

字典

IPv6 特定信息

address

字典

匹配路由地址或匹配数据包

acl

字符串

IPv6 访问列表名称

prefix_list

字符串

IPv6 前缀列表名称

flowspec

字典

匹配路由的下一跳地址

acl

字符串

IPv6 访问列表名称

dest_pfx

布尔值

匹配流规范前缀的目标前缀组件

选择

  • false

  • true

prefix_list

字符串

IPv6 前缀列表名称

src_pfx

布尔值

匹配流规范前缀的源前缀组件

选择

  • false

  • true

next_hop

字典

匹配路由的下一跳地址

acl

字符串

IPv6 访问列表名称

prefix_list

字符串

IPv6 前缀列表名称

route_source

字典

匹配路由的广告源地址

acl

字符串

IPv6 访问列表名称

prefix_list

字符串

IPv6 前缀列表名称

length

字典

数据包长度

maximum

整数

最大数据包长度

请参阅供应商文档以获取有效值

minimum

整数

最小数据包长度

请参阅供应商文档以获取有效值

local_preference

字典

路由的本地首选项

set

布尔值

设置路由的本地首选项

选择

  • false

  • true

value

列表 / elements=字符串

本地首选项值

请参阅供应商文档以获取有效值

mdt_group

字典

匹配与 MDT 组对应的路由

acls

列表 / elements=字符串

IP 访问列表编号/IP 标准访问列表名称

请参阅供应商文档以获取有效值

set

布尔值

设置和匹配与 MDT 组对应的路由

选择

  • false

  • true

metric

字典

匹配路由的度量

deviation

布尔值

在一定范围内匹配度量的偏差选项

选择

  • false

  • true

deviation_value

整数

偏差值,500 +- 10 会创建 490 - 510 的范围

请参阅供应商文档以获取有效值

external

布尔值

使用外部协议度量匹配路由

选择

  • false

  • true

value

整数

度量值

请参阅供应商文档以获取有效值

mpls_label

布尔值

匹配具有 MPLS 标签的路由

选择

  • false

  • true

policy_lists

列表 / elements=字符串

匹配 IP 策略列表

route_type

字典

匹配路由的路由类型

external

字典

外部路由(BGP、EIGRP 和 OSPF 类型 1/2)

set

布尔值

设置外部路由

选择

  • false

  • true

type_1

布尔值

OSPF 外部类型 1 路由

选择

  • false

  • true

type_2

布尔值

OSPF 外部类型 2 路由

选择

  • false

  • true

internal

布尔值

内部路由(包括 OSPF 区域内/区域间)

选择

  • false

  • true

level_1

布尔值

IS-IS 1 级路由

选择

  • false

  • true

level_2

布尔值

IS-IS 2 级路由

选择

  • false

  • true

local

布尔值

本地生成的路由

选择

  • false

  • true

nssa_external

字典

nssa-外部路由(OSPF 类型 1/2)

set

布尔值

设置 nssa-外部路由

选择

  • false

  • true

type_1

布尔值

OSPF 外部类型 1 路由

选择

  • false

  • true

type_2

布尔值

OSPF 外部类型 2 路由

选择

  • false

  • true

rpki

字典

匹配路由的 RPKI 状态

invalid

布尔值

RPKI 无效状态

选择

  • false

  • true

not_found

布尔值

RPKI 未找到状态

选择

  • false

  • true

valid

布尔值

RPKI 有效状态

选择

  • false

  • true

security_group

字典

安全组

destination

列表 / elements=整数

目标安全组,目标安全标签

请参阅供应商文档以获取有效值

source

列表 / elements=整数

源安全组,源安全标签

请参阅供应商文档以获取有效值

source_protocol

字典

匹配路由的源协议

bgp

字符串

边界网关协议 (BGP)

自治系统编号

请参阅供应商文档以获取有效值

connected

布尔值

已连接

选择

  • false

  • true

eigrp

整数

增强型内部网关路由协议 (EIGRP)

自治系统编号

请参阅供应商文档以获取有效值

isis

布尔值

ISO IS-IS

选择

  • false

  • true

lisp

布尔值

定位符 ID 分离协议 (LISP)

选择

  • false

  • true

mobile

布尔值

移动路由

选择

  • false

  • true

ospf

整数

开放最短路径优先 (OSPF) 进程 ID

请参阅供应商文档以获取有效值

ospfv3

整数

OSPFv3 进程 ID

请参阅供应商文档以获取有效值

rip

布尔值

路由信息协议 (RIP)

选择

  • false

  • true

static

布尔值

静态路由

选择

  • false

  • true

tag

字典

匹配路由的标签

tag_list

列表 / elements=字符串

路由标签列表/标签列表名称

value

列表 / elements=字符串

标签值/点分十进制标签,例如 10.10.10.10

track

整数

跟踪对象

sequence

整数

插入到现有路由映射条目或从现有路由映射条目中删除的序列

请参阅供应商文档以获取有效值

set

字典

匹配路由的源协议

aigp_metric

字典

累积的度量值

igp_metric

布尔值

来自 RIB 的度量值

选择

  • false

  • true

value

整数

手动值

as_path

字典

为 BGP AS 路径属性添加前缀字符串

prepend

字典

添加到 AS 路径的前缀

as_number

列表 / elements=字符串

AS 编号

请参阅供应商文档以获取有效值

last_as

整数

将最后一个 AS 添加到 AS 路径的前缀

最后一个 AS 添加前缀的数量

请参阅供应商文档以获取有效值

tag

布尔值

将标签设置为 AS 路径属性

选择

  • false

  • true

automatic_tag

布尔值

自动计算 TAG 值

选择

  • false

  • true

clns

字符串

OSI 汇总地址

下一跳地址

CLNS 汇总前缀

comm_list

字符串

设置 BGP 团体列表(用于删除)

团体列表名称/编号

删除匹配的团体

community

字典

BGP 团体属性

additive

布尔值

添加到现有团体

选择

  • false

  • true

gshut

布尔值

优雅关闭(知名团体)

选择

  • false

  • true

internet

布尔值

互联网(知名团体)

选择

  • false

  • true

local_as

布尔值

不要发送到本地 AS 之外(知名团体)

选择

  • false

  • true

no_advertise

布尔值

不要向任何对等体通告(知名团体)

选择

  • false

  • true

no_export

布尔值

不要导出到下一个 AS(知名团体)

选择

  • false

  • true

none

布尔值

无团体属性

选择

  • false

  • true

number

字符串

团体编号

aa:nn 格式的团体编号

请参阅供应商文档以获取有效值

dampening

字典

设置 BGP 路由震荡抑制参数

max_suppress

整数

抑制稳定路由的最大持续时间

请参阅供应商文档以获取有效值

penalty_half_time

整数

惩罚的半衰期

请参阅供应商文档以获取有效值

reuse_route_val

整数

开始重用路由的惩罚值

请参阅供应商文档以获取有效值

suppress_route_val

整数

开始抑制路由的惩罚值

请参阅供应商文档以获取有效值

default

字符串

设置默认信息

默认输出接口

extcomm_list

字符串

设置 BGP/VPN 扩展团体列表(用于删除)

扩展团体列表编号/名称

删除匹配的扩展团体

extcommunity

字典

BGP 扩展团体属性

cost

字典

成本扩展团体

cost_value

整数

成本值(无偏好成本 = 2147483647)

请参阅供应商文档以获取有效值

id

字符串

团体 ID

请参阅供应商文档以获取有效值

igp

布尔值

比较以下 IGP 成本比较

选择

  • false

  • true

pre_bestpath

布尔值

在最佳路径计算中的所有其他步骤之前进行比较

选择

  • false

  • true

rt

字典

路由目标扩展团体

additive

布尔值

添加到现有扩展团体

选择

  • false

  • true

address

字符串

VPN 扩展团体

range

字典

指定扩展团体的范围

lower_limit

字符串

VPN 扩展团体

upper_limit

字符串

VPN 扩展团体

soo

字符串

始发站点扩展团体

vpn_distinguisher

字典

VPN 区分符

additive

布尔值

添加到现有扩展团体

选择

  • false

  • true

address

字符串

VPN 扩展团体

range

字典

指定扩展团体的范围

lower_limit

字符串

VPN 扩展团体

upper_limit

字符串

VPN 扩展团体

global_route

布尔值

设置为全局路由表

选择

  • false

  • true

interfaces

列表 / elements=字符串

输出接口

ip

字典

IP 特定信息

address

字符串

指定 IP 地址

用于设置 IP 地址的前缀列表名称

df

整数

设置 DF 位

选择

  • 0

  • 1

global_route

字典

全局路由表

address

字符串

下一跳的 IP 地址

verify_availability

字典

验证下一跳是否可达

address

字符串

下一跳的 IP 地址

sequence

整数

插入到下一跳列表中的顺序

请参阅供应商文档以获取有效值

track

整数

根据跟踪对象的状态设置下一跳

跟踪对象编号

请参阅供应商文档以获取有效值

next_hop

字典

下一跳地址

address

字符串

下一跳的 IP 地址

dynamic

布尔值

应用程序动态设置下一跳

DHCP 学习到的下一跳

选择

  • false

  • true

encapsulate

字符串

VPN 下一跳的封装配置文件

L3VPN

封装配置文件名称

peer_address

布尔值

使用对等地址(仅限 BGP)

选择

  • false

  • true

recursive

字典

递归下一跳

address

字符串

递归下一跳的 IP 地址

global_route

布尔值

全局路由表

选择

  • false

  • true

vrf

字符串

VRF

self

布尔值

使用自身地址(仅限 BGP)

选择

  • false

  • true

verify_availability

字典

验证下一跳是否可达

address

字符串

下一跳的 IP 地址

sequence

整数

插入到下一跳列表中的顺序

请参阅供应商文档以获取有效值

set

布尔值

设置并验证下一跳是否可达

选择

  • false

  • true

track

整数

根据跟踪对象的状态设置下一跳

跟踪对象编号

请参阅供应商文档以获取有效值

precedence

字典

设置优先级字段

critical

布尔值

设置临界优先级 (5)

选择

  • false

  • true

flash

布尔值

设置闪速优先级 (3)

选择

  • false

  • true

flash_override

布尔值

设置闪速覆盖优先级 (4)

选择

  • false

  • true

immediate

布尔值

设置立即优先级 (2)

选择

  • false

  • true

internet

布尔值

设置网络互连控制优先级 (6)

选择

  • false

  • true

network

布尔值

设置网络控制优先级 (7)

选择

  • false

  • true

priority

布尔值

设置优先级 (1)

选择

  • false

  • true

routine

布尔值

设置例行优先级 (0)

选择

  • false

  • true

set

布尔值

仅设置优先级字段

选择

  • false

  • true

qos_group

整数

设置 QOS 组 ID

请参阅供应商文档以获取有效值

tos

字典

设置服务类型字段

max_reliability

布尔值

设置最大可靠 TOS (2)

选择

  • false

  • true

max_throughput

布尔值

设置最大吞吐量 TOS (4)

选择

  • false

  • true

min_delay

布尔值

设置最小延迟 TOS (8)

选择

  • false

  • true

min_monetary_cost

布尔值

设置最小货币成本 TOS (1)

选择

  • false

  • true

normal

布尔值

设置普通 TOS (0)

选择

  • false

  • true

set

布尔值

仅设置服务类型字段

选择

  • false

  • true

vrf

字典

VRF

address

字符串

下一跳的 IP 地址

name

字符串

VRF 名称

verify_availability

字典

验证下一跳是否可达

address

字符串

下一跳的 IP 地址

sequence

整数

插入到下一跳列表中的顺序

请参阅供应商文档以获取有效值

set

布尔值

设置并验证下一跳是否可达

选择

  • false

  • true

track

整数

根据跟踪对象的状态设置下一跳

跟踪对象编号

请参阅供应商文档以获取有效值

ipv6

字典

IPv6 特定信息

address

字符串

IPv6 地址

IPv6 前缀列表

default

布尔值

设置默认信息

选择

  • false

  • true

global_route

字典

全局路由表

address

字符串

下一跳地址 (X:X:X:X::X)

verify_availability

字典

验证下一跳是否可达

address

字符串

下一跳地址 (X:X:X:X::X)

sequence

整数

插入到下一跳列表中的顺序

请参阅供应商文档以获取有效值

track

整数

根据跟踪对象的状态设置下一跳

跟踪对象编号

请参阅供应商文档以获取有效值

next_hop

字典

IPv6 下一跳

address

字符串

下一跳地址 (X:X:X:X::X)

encapsulate

字符串

VPN 下一跳的封装配置文件

L3VPN

封装配置文件名称

peer_address

布尔值

使用对等地址(仅限 BGP)

选择

  • false

  • true

recursive

字符串

递归下一跳

递归下一跳的 IPv6 地址

precedence

整数

设置优先级字段

优先级值

请参阅供应商文档以获取有效值

vrf

字典

VRF 名称

name

字符串

VRF 名称

verify_availability

字典

验证下一跳是否可达

address

字符串

下一跳的 IPv6 地址

sequence

整数

插入到下一跳列表中的顺序

请参阅供应商文档以获取有效值

track

整数

根据跟踪对象的状态设置下一跳

跟踪对象编号

请参阅供应商文档以获取有效值

level

字典

导入路由的位置

level_1

布尔值

导入到 1 级区域

选择

  • false

  • true

level_1_2

布尔值

导入到 1 级和 2 级

选择

  • false

  • true

level_2

布尔值

导入到 2 级子域

选择

  • false

  • true

nssa_only

布尔值

仅导入到 OSPF NSSA 区域,不传播

选择

  • false

  • true

lisp

字符串

定位符 ID 分离协议特定信息

指定要在 LISP 路由导入中使用的定位符集

定位符集的名称

local_preference

整数

BGP 本地首选路径属性

请参阅供应商文档以获取有效值

metric

字典

目标路由协议的度量值

deviation

字符串

添加或减去度量

选择

  • "plus"

  • "minus"

eigrp_delay

整数

EIGRP 延迟度量,以 10 微秒为单位

请参阅供应商文档以获取有效值

metric_bandwidth

整数

EIGRP 有效带宽度量(负载),其中 255 为 100% 负载

请参阅供应商文档以获取有效值

metric_reliability

整数

EIGRP 可靠性度量,其中 255 为 100% 可靠

请参阅供应商文档以获取有效值

metric_value

整数

度量值或带宽(以千比特/秒为单位)

请参阅供应商文档以获取有效值

mtu

整数

路径的 EIGRP MTU

请参阅供应商文档以获取有效值

metric_type

字典

目标路由协议的度量类型

external

布尔值

IS-IS 外部度量

选择

  • false

  • true

internal

布尔值

IS-IS 内部度量或使用 IGP 度量作为 BGP 的 MED

选择

  • false

  • true

type_1

布尔值

OSPF 外部 1 类度量

选择

  • false

  • true

type_2

布尔值

OSPF 外部 2 类度量

选择

  • false

  • true

mpls_label

布尔值

为前缀设置 MPLS 标签

选择

  • false

  • true

origin

字典

BGP 源站代码

igp

布尔值

local IGP

选择

  • false

  • true

incomplete

布尔值

未知来源

选择

  • false

  • true

tag

字符串

目标路由协议的标签值

标签值 A.B.C.D(点分十进制格式)/标签值

traffic_index

整数

用于计费的 BGP 流量分类编号

请参阅供应商文档以获取有效值

vrf

字符串

定义 VRF 名称

VPN 路由/转发实例名称

weight

整数

路由表的 BGP 权重

请参阅供应商文档以获取有效值

route_map

字符串

路由映射标签/名称

running_config

字符串

此选项仅在状态为 parsed 时使用。

此选项的值应是通过执行命令 sh running-config | section ^route-map 从 IOS 设备收到的输出。

parsed 状态从 running_config 选项读取配置,并根据资源模块的 argspec 将其转换为 Ansible 结构化数据,然后该值将返回到结果中的 parsed 键中。

state

字符串

配置应保留的状态

renderedgatheredparsed 状态不会对设备执行任何更改。

rendered 状态会将 config 选项中的配置转换为平台特定的 CLI 命令,这些命令将返回到结果中的 rendered 键中。对于 rendered 状态,不需要与远程主机的活动连接。

gathered 状态将从设备获取运行配置,并将其转换为与资源模块 argspec 格式相同的结构化数据,该值将返回到结果的 gathered 键中。

parsed 状态从 running_config 选项读取配置,并根据资源模块参数将其转换为 JSON 格式,该值将返回到结果的 parsed 键中。running_config 选项的值应与在设备上执行的命令 sh running-config | section ^route-map 的输出格式相同。对于 parsed 状态,不需要与远程主机的活动连接。

选择

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "gathered"

  • "parsed"

  • "rendered"

备注

注意

示例

# Using deleted

# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

- name: Delete provided Route maps config
  cisco.ios.ios_route_maps:
    config:
      - route_map: test_1
    state: deleted

#  Commands Fired:
#  ---------------
#
#  "commands": [
#         "no route-map test_1"
#     ]

# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

# Using deleted without any config passed (NOTE: This will delete all Route maps configuration from device)

# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

- name: Delete all Route maps config
  cisco.ios.ios_route_maps:
    state: deleted

# Commands Fired:
# ---------------
#
#  "commands": [
#         "no route-map test_1",
#         "no route-map test_2"
#     ]

# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# router-ios#

# Using merged

# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# router-ios#

- name: Merge provided Route maps configuration
  cisco.ios.ios_route_maps:
    config:
      - route_map: test_1
        entries:
          - sequence: 10
            action: deny
            description: this is test route
            match:
              ip:
                next_hop:
                  prefix_lists:
                    - test_1_new
                    - test_2_new
                route_source:
                  acls:
                    - 10
              security_group:
                source:
                  - 10
                  - 20
              local_preference:
                value:
                  - 50
                  - 100
              mpls_label: true
          - sequence: 20
            action: deny
            continue_entry:
              entry_sequence: 100
            match:
              additional_paths:
                all: true
                group_best: true
              as_path:
                acls:
                  - 100
                  - 200
              ipv6:
                address:
                  acl: test_acl_20
              route_type:
                level_1: true
              tag:
                tag_list:
                  - test_match_tag
              track: 105
      - route_map: test_2
        entries:
          - sequence: 10
            action: deny
            match:
              ipv6:
                address:
                  acl: test_ip_acl
                next_hop:
                  prefix_list: test_new
                route_source:
                  acl: route_src_acl
              security_group:
                source:
                  - 10
                  - 20
              local_preference:
                value:
                  - 55
                  - 105
              mpls_label: true
            set:
              aigp_metric:
                value: 100
              automatic_tag: true
              extcommunity:
                cost:
                  id: 10
                  cost_value: 100
                  pre_bestpath: true
              ip:
                address: 192.0.2.1
                df: 1
                next_hop:
                  recursive:
                    global_route: true
                    address: 198.51.110.1
                  verify_availability:
                    address: 198.51.111.1
                    sequence: 100
                    track: 10
                precedence:
                  critical: true
    state: merged

#  Commands Fired:
#  ---------------
#
#   "commands": [
#      "route-map test_2 deny 10",
#      "match security-group source tag 10 20",
#      "match local-preference 55 105",
#      "match mpls-label",
#      "match ipv6 next-hop prefix-list test_new",
#      "match ipv6 route-source route_src_acl",
#      "match ipv6 address test_ip_acl",
#      "set extcommunity cost pre-bestpath 10 100",
#      "set ip df 1",
#      "set ip next-hop recursive global 198.51.110.1",
#      "set ip next-hop verify-availability 198.51.111.1 100 track 10",
#      "set ip precedence critical",
#      "set ip address prefix-list 192.0.2.1",
#      "set automatic-tag",
#      "set aigp-metric 100",
#      "route-map test_1 deny 20",
#      "continue 100",
#      "match track 105",
#      "match tag list test_match_tag",
#      "match ipv6 address test_acl_20",
#      "match route-type level-1",
#      "match as-path 200 100",
#      "match additional-paths advertise-set all group-best",
#      "route-map test_1 deny 10",
#      "description this is test route",
#      "match security-group source tag 10 20",
#      "match ip next-hop prefix-list test_2_new test_1_new",
#      "match ip route-source 10",
#      "match local-preference 100 50",
#      "match mpls-label"
#     ]

# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

# Using overridden

# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

- name: Override provided Route maps configuration
  cisco.ios.ios_route_maps:
    config:
      - route_map: test_1
        entries:
          - sequence: 10
            action: deny
            description: this is override route
            match:
              ip:
                next_hop:
                  acls:
                    - 10
                    - test1_acl
                flowspec:
                  dest_pfx: true
                  acls:
                    - test_acl_1
                    - test_acl_2
              length:
                minimum: 10
                maximum: 100
              metric:
                value: 10
                external: true
              security_group:
                source:
                  - 10
                  - 20
              mpls_label: true
            set:
              extcommunity:
                vpn_distinguisher:
                  address: 192.0.2.1:12
                  additive: true
              metric:
                metric_value: 100
                deviation: plus
                eigrp_delay: 100
                metric_reliability: 10
                metric_bandwidth: 20
                mtu: 30
      - route_map: test_override
        entries:
          - sequence: 10
            action: deny
            match:
              ipv6:
                address:
                  acl: test_acl
                next_hop:
                  prefix_list: test_new
                route_source:
                  acl: route_src_acl
              security_group:
                source:
                  - 15
                  - 20
              local_preference:
                value:
                  - 105
                  - 110
              mpls_label: true
            set:
              aigp_metric:
                value: 100
              automatic_tag: true
              extcommunity:
                cost:
                  id: 10
                  cost_value: 100
                  pre_bestpath: true
              ip:
                address: 192.0.2.1
                df: 1
                next_hop:
                  recursive:
                    global_route: true
                    address: 198.110.51.1
                  verify_availability:
                    address: 198.110.51.2
                    sequence: 100
                    track: 10
                precedence:
                  critical: true
    state: overridden

# Commands Fired:
# ---------------
#
#  "commands": [
#         "no route-map test_2",
#         "route-map test_override deny 10",
#         "match security-group source tag 15 20",
#         "match local-preference 110 105",
#         "match mpls-label",
#         "match ipv6 next-hop prefix-list test_new",
#         "match ipv6 route-source route_src_acl",
#         "match ipv6 address test_acl",
#         "set extcommunity cost pre-bestpath 10 100",
#         "set ip df 1",
#         "set ip next-hop recursive global 198.110.51.1",
#         "set ip next-hop verify-availability 198.110.51.2 100 track 10",
#         "set ip precedence critical",
#         "set ip address prefix-list 192.0.2.1",
#         "set automatic-tag",
#         "set aigp-metric 100",
#         "route-map test_1 deny 10",
#         "no description this is test route",
#         "description this is override route",
#         "match ip flowspec dest-pfx test_acl_1 test_acl_2",
#         "no match ip next-hop prefix-list test_2_new test_1_new",
#         "match ip next-hop test1_acl 10",
#         "no match ip route-source 10",
#         "match metric external 10",
#         "match length 10 100",
#         "no match local-preference 100 50",
#         "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
#         "set metric 100 +100 10 20 30",
#         "no route-map test_1 deny 20"
#     ]

# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_override deny 10
#  match security-group source tag 15 20
#  match local-preference 110 105
#  match mpls-label
#  match ipv6 address test_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.110.51.2 100 track 10
#  set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
#  description this is override route
#  match ip flowspec dest-pfx test_acl_1 test_acl_2
#  match ip next-hop test1_acl 10
#  match security-group source tag 10 20
#  match metric external 10
#  match mpls-label
#  match length 10 100
#  set metric 100 +100 10 20 30
#  set extcommunity vpn-distinguisher 192.0.2.1:12 additive

# Using replaced

# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

- name: Replaced provided Route maps configuration
  cisco.ios.ios_route_maps:
    config:
      - route_map: test_1
        entries:
          - sequence: 10
            action: deny
            description: this is replaced route
            match:
              ip:
                next_hop:
                  acls:
                    - 10
                    - test1_acl
                flowspec:
                  dest_pfx: true
                  acls:
                    - test_acl_1
                    - test_acl_2
              length:
                minimum: 10
                maximum: 100
              metric:
                value: 10
                external: true
              security_group:
                source:
                  - 10
                  - 20
              mpls_label: true
            set:
              extcommunity:
                vpn_distinguisher:
                  address: 192.0.2.1:12
                  additive: true
              metric:
                metric_value: 100
                deviation: plus
                eigrp_delay: 100
                metric_reliability: 10
                metric_bandwidth: 20
                mtu: 30
      - route_map: test_replaced
        entries:
          - sequence: 10
            action: deny
            match:
              ipv6:
                address:
                  acl: test_acl
                next_hop:
                  prefix_list: test_new
                route_source:
                  acl: route_src_acl
              security_group:
                source:
                  - 15
                  - 20
              local_preference:
                value:
                  - 105
                  - 110
              mpls_label: true
            set:
              aigp_metric:
                value: 100
              automatic_tag: true
              extcommunity:
                cost:
                  id: 10
                  cost_value: 100
                  pre_bestpath: true
              ip:
                address: 192.0.2.1
                df: 1
                next_hop:
                  recursive:
                    global_route: true
                    address: 198.110.51.1
                  verify_availability:
                    address: 198.110.51.2
                    sequence: 100
                    track: 10
                precedence:
                  critical: true
    state: replaced

# Commands Fired:
# ---------------
#  "commands": [
#         "route-map test_replaced deny 10",
#         "match security-group source tag 15 20",
#         "match local-preference 110 105",
#         "match mpls-label",
#         "match ipv6 next-hop prefix-list test_new",
#         "match ipv6 route-source route_src_acl",
#         "match ipv6 address test_acl",
#         "set extcommunity cost pre-bestpath 10 100",
#         "set ip df 1",
#         "set ip next-hop recursive global 198.110.51.1",
#         "set ip next-hop verify-availability 198.110.51.2 100 track 10",
#         "set ip precedence critical",
#         "set ip address prefix-list 192.0.2.1",
#         "set automatic-tag",
#         "set aigp-metric 100",
#         "route-map test_1 deny 10",
#         "no description this is test route",
#         "description this is replaced route",
#         "match ip flowspec dest-pfx test_acl_1 test_acl_2",
#         "no match ip next-hop prefix-list test_2_new test_1_new",
#         "match ip next-hop test1_acl 10",
#         "no match ip route-source 10",
#         "match metric external 10",
#         "match length 10 100",
#         "no match local-preference 100 50",
#         "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
#         "set metric 100 +100 10 20 30",
#         "no route-map test_1 deny 20"
#     ]

# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_replaced deny 10
#  match security-group source tag 15 20
#  match local-preference 110 105
#  match mpls-label
#  match ipv6 address test_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.110.51.2 100 track 10
#  set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
#  description this is replaced route
#  match ip flowspec dest-pfx test_acl_1 test_acl_2
#  match ip next-hop test1_acl 10
#  match security-group source tag 10 20
#  match metric external 10
#  match mpls-label
#  match length 10 100
#  set metric 100 +100 10 20 30
#  set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

# Using Gathered

# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

- name: Gather Route maps provided configurations
  cisco.ios.ios_route_maps:
    config:
    state: gathered

# Module Execution Result:
# ------------------------
#
# "gathered": [
#         {
#             "entries": [
#                 {
#                     "action": "deny",
#                     "description": "this is test route",
#                     "match": {
#                         "ip": {
#                             "next_hop": {
#                                 "prefix_lists": [
#                                     "test_2_new",
#                                     "test_1_new"
#                                 ]
#                             },
#                             "route_source": {
#                                 "acls": [
#                                     "10"
#                                 ]
#                             }
#                         },
#                         "local_preference": {
#                             "value": [
#                                 "100",
#                                 "50"
#                             ]
#                         },
#                         "mpls_label": true,
#                         "security_group": {
#                             "source": [
#                                 10,
#                                 20
#                             ]
#                         }
#                     },
#                     "sequence": 10
#                 },
#                 {
#                     "action": "deny",
#                     "continue_entry": {
#                         "entry_sequence": 100
#                     },
#                     "match": {
#                         "additional_paths": {
#                             "all": true,
#                             "group_best": true
#                         },
#                         "as_path": {
#                             "acls": [
#                                 200,
#                                 100
#                             ]
#                         },
#                         "ipv6": {
#                             "address": {
#                                 "acl": "test_acl_20"
#                             }
#                         },
#                         "route_type": {
#                             "external": {
#                                 "set": true
#                             },
#                             "level_1": true,
#                             "nssa_external": {
#                                 "set": true
#                             }
#                         },
#                         "tag": {
#                             "tag_list": [
#                                 "test_match_tag"
#                             ]
#                         },
#                         "track": 105
#                     },
#                     "sequence": 20
#                 }
#             ],
#             "route_map": "test_1"
#         },
#         {
#             "entries": [
#                 {
#                     "action": "deny",
#                     "match": {
#                         "ipv6": {
#                             "address": {
#                                 "acl": "test_ip_acl"
#                             },
#                             "next_hop": {
#                                 "prefix_list": "test_new"
#                             },
#                             "route_source": {
#                                 "acl": "route_src_acl"
#                             }
#                         },
#                         "local_preference": {
#                             "value": [
#                                 "55",
#                                 "105"
#                             ]
#                         },
#                         "mpls_label": true,
#                         "security_group": {
#                             "source": [
#                                 10,
#                                 20
#                             ]
#                         }
#                     },
#                     "sequence": 10,
#                     "set": {
#                         "aigp_metric": {
#                             "value": 100
#                         },
#                         "automatic_tag": true,
#                         "extcommunity": {
#                             "cost": {
#                                 "cost_value": 100,
#                                 "id": "10",
#                                 "pre_bestpath": true
#                             }
#                         },
#                         "ip": {
#                             "address": "192.0.2.1",
#                             "df": 1,
#                             "next_hop": {
#                                 "recursive": {
#                                     "address": "198.51.110.1",
#                                     "global_route": true
#                                 },
#                                 "verify_availability": {
#                                     "address": "198.51.111.1",
#                                     "sequence": 100,
#                                     "track": 10
#                                 }
#                             },
#                             "precedence": {
#                                 "critical": true
#                             }
#                         }
#                     }
#                 }
#             ],
#             "route_map": "test_2"
#         }
#     ]

# After state:
# ------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

# Using Rendered

- name: Render the commands for provided  configuration
  cisco.ios.ios_route_maps:
    config:
      - route_map: test_1
        entries:
          - sequence: 10
            action: deny
            description: this is test route
            match:
              ip:
                next_hop:
                  prefix_lists:
                    - test_1_new
                    - test_2_new
                route_source:
                  acls:
                    - 10
              security_group:
                source:
                  - 10
                  - 20
              local_preference:
                value:
                  - 50
                  - 100
              mpls_label: true
          - sequence: 20
            action: deny
            continue_entry:
              entry_sequence: 100
            match:
              additional_paths:
                all: true
                group_best: true
              as_path:
                acls:
                  - 100
                  - 200
              ipv6:
                address:
                  acl: test_acl_20
              route_type:
                level_1: true
              tag:
                tag_list:
                  - test_match_tag
              track: 105
      - route_map: test_2
        entries:
          - sequence: 10
            action: deny
            match:
              ipv6:
                address:
                  acl: test_ip_acl
                next_hop:
                  prefix_list: test_new
                route_source:
                  acl: route_src_acl
              security_group:
                source:
                  - 10
                  - 20
              local_preference:
                value:
                  - 55
                  - 105
              mpls_label: true
            set:
              aigp_metric:
                value: 100
              automatic_tag: true
              extcommunity:
                cost:
                  id: 10
                  cost_value: 100
                  pre_bestpath: true
              ip:
                address: 192.0.2.1
                df: 1
                next_hop:
                  recursive:
                    global_route: true
                    address: 198.51.110.1
                  verify_availability:
                    address: 198.51.111.1
                    sequence: 100
                    track: 10
                precedence:
                  critical: true
    state: rendered

# Module Execution Result:
# ------------------------
#
#  "rendered": [
#      "route-map test_2 deny 10",
#      "match security-group source tag 10 20",
#      "match local-preference 55 105",
#      "match mpls-label",
#      "match ipv6 next-hop prefix-list test_new",
#      "match ipv6 route-source route_src_acl",
#      "match ipv6 address test_ip_acl",
#      "set extcommunity cost pre-bestpath 10 100",
#      "set ip df 1",
#      "set ip next-hop recursive global 198.51.110.1",
#      "set ip next-hop verify-availability 198.51.111.1 100 track 10",
#      "set ip precedence critical",
#      "set ip address prefix-list 192.0.2.1",
#      "set automatic-tag",
#      "set aigp-metric 100",
#      "route-map test_1 deny 20",
#      "continue 100",
#      "match track 105",
#      "match tag list test_match_tag",
#      "match ipv6 address test_acl_20",
#      "match route-type level-1",
#      "match as-path 200 100",
#      "match additional-paths advertise-set all group-best",
#      "route-map test_1 deny 10",
#      "description this is test route",
#      "match security-group source tag 10 20",
#      "match ip next-hop prefix-list test_2_new test_1_new",
#      "match ip route-source 10",
#      "match local-preference 100 50",
#      "match mpls-label"
#     ]

# Using Parsed

# File: parsed.cfg
# ----------------
#
# route-map test_1 deny 10
#  description this is test route
#  match ip next-hop prefix-list test_2_new test_1_new
#  match ip route-source 10
#  match security-group source tag 10 20
#  match local-preference 100 50
#  match mpls-label
# route-map test_1 deny 20
#  match track  105
#  match tag list test_match_tag
#  match route-type level-1
#  match additional-paths advertise-set all group-best
#  match as-path 200 100
#  match ipv6 address test_acl_20
#  continue 100
# route-map test_2 deny 10
#  match security-group source tag 10 20
#  match local-preference 55 105
#  match mpls-label
#  match ipv6 address test_ip_acl
#  match ipv6 next-hop prefix-list test_new
#  match ipv6 route-source route_src_acl
#  set automatic-tag
#  set ip precedence critical
#  set ip address prefix-list 192.0.2.1
#  set aigp-metric 100
#  set extcommunity cost pre-bestpath 10 100
#  set ip df 1
#  set ip next-hop verify-availability 198.51.111.1 100 track 10
#  set ip next-hop recursive global 198.51.110.1

- name: Parse the provided configuration with the existing running configuration
  cisco.ios.ios_route_maps:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Module Execution Result:
# ------------------------
#
# "parsed": [
#         {
#             "entries": [
#                 {
#                     "action": "deny",
#                     "description": "this is test route",
#                     "match": {
#                         "ip": {
#                             "next_hop": {
#                                 "prefix_lists": [
#                                     "test_2_new",
#                                     "test_1_new"
#                                 ]
#                             },
#                             "route_source": {
#                                 "acls": [
#                                     "10"
#                                 ]
#                             }
#                         },
#                         "local_preference": {
#                             "value": [
#                                 "100",
#                                 "50"
#                             ]
#                         },
#                         "mpls_label": true,
#                         "security_group": {
#                             "source": [
#                                 10,
#                                 20
#                             ]
#                         }
#                     },
#                     "sequence": 10
#                 },
#                 {
#                     "action": "deny",
#                     "continue_entry": {
#                         "entry_sequence": 100
#                     },
#                     "match": {
#                         "additional_paths": {
#                             "all": true,
#                             "group_best": true
#                         },
#                         "as_path": {
#                             "acls": [
#                                 200,
#                                 100
#                             ]
#                         },
#                         "ipv6": {
#                             "address": {
#                                 "acl": "test_acl_20"
#                             }
#                         },
#                         "route_type": {
#                             "external": {
#                                 "set": true
#                             },
#                             "level_1": true,
#                             "nssa_external": {
#                                 "set": true
#                             }
#                         },
#                         "tag": {
#                             "tag_list": [
#                                 "test_match_tag"
#                             ]
#                         },
#                         "track": 105
#                     },
#                     "sequence": 20
#                 }
#             ],
#             "route_map": "test_1"
#         },
#         {
#             "entries": [
#                 {
#                     "action": "deny",
#                     "match": {
#                         "ipv6": {
#                             "address": {
#                                 "acl": "test_ip_acl"
#                             },
#                             "next_hop": {
#                                 "prefix_list": "test_new"
#                             },
#                             "route_source": {
#                                 "acl": "route_src_acl"
#                             }
#                         },
#                         "local_preference": {
#                             "value": [
#                                 "55",
#                                 "105"
#                             ]
#                         },
#                         "mpls_label": true,
#                         "security_group": {
#                             "source": [
#                                 10,
#                                 20
#                             ]
#                         }
#                     },
#                     "sequence": 10,
#                     "set": {
#                         "aigp_metric": {
#                             "value": 100
#                         },
#                         "automatic_tag": true,
#                         "extcommunity": {
#                             "cost": {
#                                 "cost_value": 100,
#                                 "id": "10",
#                                 "pre_bestpath": true
#                             }
#                         },
#                         "ip": {
#                             "address": "192.0.2.1",
#                             "df": 1,
#                             "next_hop": {
#                                 "recursive": {
#                                     "address": "198.51.110.1",
#                                     "global_route": true
#                                 },
#                                 "verify_availability": {
#                                     "address": "198.51.111.1",
#                                     "sequence": 100,
#                                     "track": 10
#                                 }
#                             },
#                             "precedence": {
#                                 "critical": true
#                             }
#                         }
#                     }
#                 }
#             ],
#             "route_map": "test_2"
#         }
#     ]

返回值

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

描述

after

列表 / elements=字符串

生成的配置模型调用。

返回:当更改时

示例: ["返回的配置将始终采用与上述参数相同的格式\n"]

before

列表 / elements=字符串

模型调用之前的配置。

返回:总是

示例: ["返回的配置将始终采用与上述参数相同的格式\n"]

commands

列表 / elements=字符串

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

返回:总是

示例: ["route-map test_1 deny 10", "description this is test route", "match ip route-source 10", "match track 105"]

作者

  • Sumit Jaiswal (@justjais)