cisco.nxos.nxos_ospfv2 模块 – OSPFv2 资源模块
注意
此模块是 cisco.nxos 集合 (版本 9.2.1) 的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。 它不包含在 ansible-core
中。 要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.nxos
。
要在 playbook 中使用它,请指定:cisco.nxos.nxos_ospfv2
。
cisco.nxos 1.0.0 中的新增功能
概要
此模块管理运行 Cisco NX-OS 的设备上的 OSPFv2 配置。
参数
参数 |
注释 |
---|---|
OSPF 进程配置的列表。 |
|
OSPF 实例配置的列表。 |
|
配置 OSPF 区域的属性。 |
|
IP 地址格式的区域 ID。 |
|
区域的身份验证设置。 |
|
使用消息摘要身份验证。 选择
|
|
设置区域的身份验证。 选择
|
|
指定默认汇总 LSA 的默认成本。 |
|
过滤 OSPF 区域之间的前缀。 |
|
应用路由映射的方向。 选择
|
|
路由映射名称。 |
|
区域的 NSSA 设置。 |
|
将 Type-7 默认 LSA 发起到 NSSA 区域。 选择
|
|
不要将重新分发的 LSA 发送到 NSSA 区域。 选择
|
|
不要将汇总 LSA 发送到 NSSA 区域。 选择
|
|
将区域配置为 NSSA。 选择
|
|
转换 LSA。 |
|
从 Type 7 转换为 Type 5。 |
|
始终转换 LSA 选择
|
|
从不转换 LSA 选择
|
|
在转换的 LSA 中禁止转发地址。 选择
|
|
配置区域的地址范围。 |
|
用于范围的成本。 |
|
禁止通告指定的范围。 选择
|
|
前缀格式的 IP (x.x.x.x/len) |
|
用于将区域配置为末梢的设置。 |
|
防止 ABR 将汇总 LSA 发送到末梢区域。 选择
|
|
将区域配置为末梢。 选择
|
|
根据带宽计算 OSPF 成本。 |
|
用于分配 OSPF 成本的参考带宽。 |
|
指定参考带宽的单位。 选择
|
|
在所有 OSPF 接口上启用 BFD。 选择
|
|
控制默认路由的分布。 |
|
发布默认路由。 |
|
始终通告默认路由。 选择
|
|
控制默认路由分发的策略 |
|
启用默认路由的分发。 选择
|
|
指定重新分发的路由的默认指标。 |
|
配置 OSPF 管理距离。 |
|
在非平稳控制重启时刷新路由。 选择
|
|
配置平稳重启。 |
|
配置平稳重启的最大间隔。 |
|
启用/禁用助手模式。 选择
|
|
启用平稳重启。 选择
|
|
从 OSPF 角度隔离此路由器。 选择
|
|
记录邻接状态的更改。 |
|
通知所有状态更改。 选择
|
|
启用/禁用记录邻接状态的更改。 选择
|
|
限制非自身始发 LSA 数量的功能。 |
|
设置可以抑制邻接的次数。 |
|
设置抑制所有邻接的时间。 |
|
设置非自身生成 LSA 的最大数量。 |
|
设置在多少分钟后将 ignore-count 重置为零。 |
|
生成警告消息的阈值 (%)。 |
|
超出限制时记录警告消息。 选择
|
|
最大化成本指标。 |
|
路由器 LSA 配置。 |
|
外部 LSA 配置。 |
|
为外部 LSA 设置最大指标值。 |
|
设置 external-lsa 属性。 选择
|
|
也为末梢链接通告最大指标。 选择
|
|
仅在启动时有效。 |
|
设置 on-startup 属性。 选择
|
|
等待的 BGP 的 ASN。 |
|
启动后等待的秒数。 |
|
设置 router-lsa 属性。 选择
|
|
汇总 LSA 配置。 |
|
汇总 LSA 的最大度量值。 |
|
设置 summary-lsa 属性。 选择
|
|
每个目标的最大路径数。 |
|
OSPF MPLS 配置设置。 |
|
OSPF MPLS 流量工程命令。 |
|
区域 ID 列表。 |
|
IP 地址格式的区域 ID。 |
|
MPLS TE 多播支持。 选择
|
|
与 TE 关联的路由器 ID。 |
|
将 OSPF 路由器 ID 显示为 DNS 名称。 选择
|
|
禁止在接口上发送路由更新。 |
|
默认情况下,接口处于被动模式。 选择
|
|
OSPF 进程标签。 |
|
从另一个路由协议重新分配信息。 |
|
指定协议的标识符。 |
|
协议的名称。 选择
|
|
用于约束重新分配的路由映射策略。 |
|
为外部路径首选项配置 1583 兼容性。 选择
|
|
设置 OSPF 进程路由器 ID。 |
|
关闭 OSPF 协议实例。 选择
|
|
配置重新分配的路由汇总。 |
|
禁止通告指定的汇总。 选择
|
|
格式为 x.x.x.x/ml 的 IP 前缀。 |
|
32 位标签值。 |
|
用于在将 OSPF 路由发送到 RIB 之前对其进行过滤/修改的策略。 |
|
阻止将 OSPF 路由发送到 RIB。 选择
|
|
路由映射名称。 |
|
配置与计时器相关的常量。 |
|
LSA 到达之间的最小间隔。 |
|
LSA 组刷新/最大期限间隔。 |
|
配置与节流相关的常量。 |
|
设置 LSA 生成的速率限制。 |
|
保持间隔。 |
|
最大间隔。 |
|
起始间隔。 |
|
设置 OSPF SPF 计时器。 |
|
初始 SPF 计划延迟(毫秒)。 |
|
SPF 计算之间的最大等待时间。 |
|
SPF 计算之间的最小保持时间。 |
|
配置 VRF 特定的 OSPF 设置。 |
|
配置 OSPF 区域的属性。 |
|
IP 地址格式的区域 ID。 |
|
区域的身份验证设置。 |
|
使用消息摘要身份验证。 选择
|
|
设置区域的身份验证。 选择
|
|
指定默认汇总 LSA 的默认成本。 |
|
过滤 OSPF 区域之间的前缀。 |
|
应用路由映射的方向。 选择
|
|
路由映射名称。 |
|
区域的 NSSA 设置。 |
|
将 Type-7 默认 LSA 发起到 NSSA 区域。 选择
|
|
不要将重新分发的 LSA 发送到 NSSA 区域。 选择
|
|
不要将汇总 LSA 发送到 NSSA 区域。 选择
|
|
将区域配置为 NSSA。 选择
|
|
转换 LSA。 |
|
从 Type 7 转换为 Type 5。 |
|
始终转换 LSA 选择
|
|
从不转换 LSA 选择
|
|
在转换的 LSA 中禁止转发地址。 选择
|
|
配置区域的地址范围。 |
|
用于范围的成本。 |
|
禁止通告指定的范围。 选择
|
|
前缀格式的 IP (x.x.x.x/len) |
|
用于将区域配置为末梢的设置。 |
|
防止 ABR 将汇总 LSA 发送到末梢区域。 选择
|
|
将区域配置为末梢。 选择
|
|
根据带宽计算 OSPF 成本。 |
|
用于分配 OSPF 成本的参考带宽。 |
|
指定参考带宽的单位。 选择
|
|
在所有 OSPF 接口上启用 BFD。 选择
|
|
OSPF 功能设置。 |
|
启用 VRF-lite 功能设置。 |
|
以太网 VPN。 选择
|
|
启用 VRF-lite 支持。 选择
|
|
控制默认路由的分布。 |
|
发布默认路由。 |
|
始终通告默认路由。 选择
|
|
控制默认路由分发的策略 |
|
启用默认路由的分发。 选择
|
|
指定重新分发的路由的默认指标。 |
|
配置 OSPF 管理距离。 |
|
配置 PE 路由器以忽略网络汇总、外部和 NSSA 外部 LSA 的 DN 位。 选择
|
|
配置平稳重启。 |
|
配置平稳重启的最大间隔。 |
|
启用/禁用助手模式。 选择
|
|
启用平稳重启。 选择
|
|
记录邻接状态的更改。 |
|
通知所有状态更改。 选择
|
|
启用/禁用记录邻接状态的更改。 选择
|
|
限制非自身始发 LSA 数量的功能。 |
|
设置可以抑制邻接的次数。 |
|
设置抑制所有邻接的时间。 |
|
设置非自身生成 LSA 的最大数量。 |
|
设置在多少分钟后将 ignore-count 重置为零。 |
|
生成警告消息的阈值 (%)。 |
|
超出限制时记录警告消息。 选择
|
|
最大化成本指标。 |
|
路由器 LSA 配置。 |
|
外部 LSA 配置。 |
|
为外部 LSA 设置最大指标值。 |
|
设置 external-lsa 属性。 选择
|
|
也为末梢链接通告最大指标。 选择
|
|
仅在启动时有效。 |
|
设置 on-startup 属性。 选择
|
|
等待的 BGP 的 ASN。 |
|
启动后等待的秒数。 |
|
设置 router-lsa 属性。 选择
|
|
汇总 LSA 配置。 |
|
汇总 LSA 的最大度量值。 |
|
设置 summary-lsa 属性。 选择
|
|
每个目标的最大路径数。 |
|
将 OSPF 路由器 ID 显示为 DNS 名称。 选择
|
|
禁止在接口上发送路由更新。 |
|
默认情况下,接口处于被动模式。 选择
|
|
从另一个路由协议重新分配信息。 |
|
指定协议的标识符。 |
|
协议的名称。 选择
|
|
用于约束重新分配的路由映射策略。 |
|
为外部路径首选项配置 1583 兼容性。 选择
|
|
设置 OSPF 进程路由器 ID。 |
|
关闭 OSPF 协议实例。 选择
|
|
配置重新分配的路由汇总。 |
|
禁止通告指定的汇总。 选择
|
|
格式为 x.x.x.x/ml 的 IP 前缀。 |
|
32 位标签值。 |
|
用于在将 OSPF 路由发送到 RIB 之前对其进行过滤/修改的策略。 |
|
阻止将 OSPF 路由发送到 RIB。 选择
|
|
路由映射名称。 |
|
配置与计时器相关的常量。 |
|
LSA 到达之间的最小间隔。 |
|
LSA 组刷新/最大期限间隔。 |
|
配置与节流相关的常量。 |
|
设置 LSA 生成的速率限制。 |
|
保持间隔。 |
|
最大间隔。 |
|
起始间隔。 |
|
设置 OSPF SPF 计时器。 |
|
初始 SPF 计划延迟(毫秒)。 |
|
SPF 计算之间的最大等待时间。 |
|
SPF 计算之间的最小保持时间。 |
|
VRF 的名称/标识符。 |
|
此选项仅在状态为 *parsed* 时使用。 此选项的值应该是通过执行命令 **show running-config | section “^router ospf .*”** 从 NX-OS 设备接收到的输出。 状态 *parsed* 从 |
|
配置应保留的状态。 选择
|
备注
注意
已针对 NX-OS 7.0(3)I5(1) 进行测试。
不支持 Cisco MDS
此模块适用于连接
network_cli
和httpapi
。
示例
# Using merged
# Before state:
# -------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# nxos-9k-rdo#
- name: Merge the provided configuration with the existing running configuration
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 100
router_id: 203.0.113.20
- process_id: 102
router_id: 198.51.100.1
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_1
direction: in
- route_map: rmap_2
direction: out
ranges:
- prefix: 198.51.100.64/27
not_advertise: true
- prefix: 198.51.100.96/27
cost: 120
- area_id: 0.0.0.101
authentication:
message_digest: true
redistribute:
- protocol: eigrp
id: 120
route_map: rmap_1
- protocol: direct
route_map: ospf102-direct-connect
vrfs:
- vrf: zone1
router_id: 198.51.100.129
redistribute:
- protocol: static
route_map: zone1-static-connect
summary_address:
- prefix: 198.51.100.128/27
tag: 121
- prefix: 198.51.100.160/27
areas:
- area_id: 0.0.0.102
nssa:
default_information_originate: true
no_summary: true
- area_id: 0.0.0.103
nssa:
no_summary: true
translate:
type7:
always: true
- vrf: zone2
auto_cost:
reference_bandwidth: 45
unit: Gbps
state: merged
# Task output:
# ------------
# before: {}
#
# commands:
# - router ospf 102
# - router-id 198.51.100.1
# - redistribute eigrp 120 route-map rmap_1
# - redistribute direct route-map ospf102-direct-connect
# - area 0.0.0.100 filter-list route-map rmap_1 in
# - area 0.0.0.100 filter-list route-map rmap_2 out
# - area 0.0.0.100 range 198.51.100.64/27 not-advertise
# - area 0.0.0.100 range 198.51.100.96/27 cost 120
# - area 0.0.0.101 authentication message-digest
# - vrf zone1
# - router-id 198.51.100.129
# - summary-address 198.51.100.128/27 tag 121
# - summary-address 198.51.100.160/27
# - redistribute static route-map zone1-static-connect
# - area 0.0.0.102 nssa no-summary default-information-originate
# - area 0.0.0.103 nssa no-summary
# - area 0.0.0.103 nssa translate type7 always
# - vrf zone2
# - auto-cost reference-bandwidth 45 Gbps
# - router ospf 100
# - router-id 203.0.113.20
#
# after:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
# Using replaced
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: >-
Replace device configurations of listed OSPF processes with provided
configurations
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 102
router_id: 198.51.100.1
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_8
direction: in
ranges:
- prefix: 198.51.100.64/27
not_advertise: true
- area_id: 0.0.0.101
stub:
no_summary: true
redistribute:
- protocol: eigrp
id: 130
route_map: rmap_1
- protocol: direct
route_map: ospf102-direct-connect
vrfs:
- vrf: zone1
router_id: 198.51.100.129
redistribute:
- protocol: bgp
id: 65563
route_map: zone1-bgp-connect
areas:
- area_id: 0.0.0.102
nssa:
default_information_originate: true
no_summary: true
state: replaced
# Task output:
# ------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - router ospf 102
# - redistribute eigrp 130 route-map rmap_1
# - no redistribute eigrp 120 route-map rmap_1
# - area 0.0.0.100 filter-list route-map rmap_8 in
# - no area 0.0.0.100 filter-list route-map rmap_2 out
# - no area 0.0.0.100 range 198.51.100.96/27
# - no area 0.0.0.101 authentication
# - area 0.0.0.101 stub no-summary
# - vrf zone1
# - no summary-address 198.51.100.128/27 tag 121
# - no summary-address 198.51.100.160/27
# - redistribute bgp 65563 route-map zone1-bgp-connect
# - no redistribute static route-map zone1-static-connect
# - no area 0.0.0.103 nssa
# - no area 0.0.0.103 nssa translate type7 always
# - no vrf zone2
#
# after:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.101
# stub:
# no_summary: true
# - area_id: 0.0.0.100
# filter_list:
# - direction: in
# route_map: rmap_8
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "130"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# redistribute:
# - id: "65563"
# protocol: bgp
# route_map: zone1-bgp-connect
# router_id: 198.51.100.129
# vrf: zone1
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# area 0.0.0.101 stub no-summary
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 130 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_8 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# redistribute bgp 65563 route-map zone1-bgp-connect
# Using overridden
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Override all OSPF configuration with provided configuration
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 104
router_id: 203.0.113.20
- process_id: 102
router_id: 198.51.100.1
shutdown: true
state: overridden
# Task output:
# ------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - no router ospf 100
# - router ospf 104
# - router-id 203.0.113.20
# - router ospf 102
# - shutdown
# - no redistribute direct route-map ospf102-direct-connect
# - no redistribute eigrp 120 route-map rmap_1
# - no area 0.0.0.100 filter-list route-map rmap_2 out
# - no area 0.0.0.100 filter-list route-map rmap_1 in
# - no area 0.0.0.100 range 198.51.100.64/27
# - no area 0.0.0.100 range 198.51.100.96/27
# - no area 0.0.0.101 authentication
# - no vrf zone1
# - no vrf zone2
#
# after:
# processes:
# - process_id: "102"
# router_id: 198.51.100.1
# shutdown: true
# - process_id: "104"
# router_id: 203.0.113.20
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 102
# router-id 198.51.100.1
# shutdown
# router ospf 104
# router-id 203.0.113.20
# Using deleted to delete a single OSPF process
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Delete a single OSPF process
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 102
state: deleted
# Task output:
# ------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - no router ospf 102
#
# after:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# Using deleted all OSPF processes from the device
# Before state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# router ospf 100
# router-id 203.0.113.20
# router ospf 102
# router-id 198.51.100.1
# redistribute direct route-map ospf102-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 198.51.100.64/27 not-advertise
# area 0.0.0.100 range 198.51.100.96/27 cost 120
# area 0.0.0.101 authentication message-digest
# vrf zone1
# router-id 198.51.100.129
# area 0.0.0.102 nssa no-summary default-information-originate
# area 0.0.0.103 nssa no-summary
# area 0.0.0.103 nssa translate type7 always
# redistribute static route-map zone1-static-connect
# summary-address 198.51.100.128/27 tag 121
# summary-address 198.51.100.160/27
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
- name: Delete all OSPF processes from the device
cisco.nxos.nxos_ospfv2:
state: deleted
# Task output:
# ------------
# before:
# processes:
# - process_id: "100"
# router_id: 203.0.113.20
# - areas:
# - area_id: 0.0.0.100
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# - cost: 120
# prefix: 198.51.100.96/27
# - area_id: 0.0.0.101
# authentication:
# message_digest: true
# process_id: "102"
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# - area_id: 0.0.0.103
# nssa:
# no_summary: true
# translate:
# type7:
# always: true
# redistribute:
# - protocol: static
# route_map: zone1-static-connect
# router_id: 198.51.100.129
# vrf: zone1
# - auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# vrf: zone2
#
# commands:
# - no router ospf 100
# - no router ospf 102
#
# after: {}
# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospf .*"
# nxos-9k-rdo#
# Using rendered
- name: >-
Render platform specific configuration lines (without connecting to the
device)
cisco.nxos.nxos_ospfv2:
config:
processes:
- process_id: 100
router_id: 203.0.113.20
- process_id: 102
router_id: 198.51.100.1
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_1
direction: in
- route_map: rmap_2
direction: out
ranges:
- prefix: 198.51.100.64/27
not_advertise: true
- prefix: 198.51.100.96/27
cost: 120
- area_id: 0.0.0.101
authentication:
message_digest: true
redistribute:
- protocol: eigrp
id: 120
route_map: rmap_1
- protocol: direct
route_map: ospf102-direct-connect
vrfs:
- vrf: zone1
router_id: 198.51.100.129
redistribute:
- protocol: static
route_map: zone1-static-connect
summary_address:
- prefix: 198.51.100.128/27
tag: 121
- prefix: 198.51.100.160/27
areas:
- area_id: 0.0.0.102
nssa:
default_information_originate: true
no_summary: true
- area_id: 0.0.0.103
nssa:
no_summary: true
translate:
type7:
always: true
- vrf: zone2
auto_cost:
reference_bandwidth: 45
unit: Gbps
state: rendered
# Task output:
# ------------
# rendered:
# - router ospf 100
# - router-id 203.0.113.20
# - router ospf 102
# - router-id 198.51.100.1
# - redistribute eigrp 120 route-map rmap_1
# - redistribute direct route-map ospf102-direct-connect
# - area 0.0.0.100 filter-list route-map rmap_1 in
# - area 0.0.0.100 filter-list route-map rmap_2 out
# - area 0.0.0.100 range 198.51.100.64/27 not-advertise
# - area 0.0.0.100 range 198.51.100.96/27 cost 120
# - area 0.0.0.101 authentication message-digest
# - vrf zone1
# - router-id 198.51.100.129
# - summary-address 198.51.100.128/27 tag 121
# - summary-address 198.51.100.160/27
# - redistribute static route-map zone1-static-connect
# - area 0.0.0.102 nssa no-summary default-information-originate
# - area 0.0.0.103 nssa no-summary
# - area 0.0.0.103 nssa translate type7 always
# - vrf zone2
# - auto-cost reference-bandwidth 45 Gbps
# Using parsed
# parsed.cfg
# ------------
# router ospf 100
# router-id 192.0.100.1
# area 0.0.0.101 nssa no-summary no-redistribution
# area 0.0.0.102 stub no-summary
# redistribute direct route-map ospf-direct-connect
# redistribute eigrp 120 route-map rmap_1
# area 0.0.0.100 filter-list route-map rmap_2 out
# area 0.0.0.100 filter-list route-map rmap_1 in
# area 0.0.0.100 range 192.0.2.0/24 not-advertise
# area 0.0.0.100 range 192.0.3.0/24 cost 120
# area 0.0.0.100 authentication message-digest
# vrf zone1
# router-id 192.0.100.2
# area 0.0.100.1 nssa no-summary no-redistribution
# redistribute static route-map zone1-direct-connect
# summary-address 10.0.0.0/24 tag 120
# summary-address 11.0.0.0/24 not-advertise
# vrf zone2
# auto-cost reference-bandwidth 45 Gbps
# down-bit-ignore
# capability vrf-lite evpn
# shutdown
# router ospf 102
# router-id 198.54.100.1
# shutdown
# vrf zone2
# summary-address 192.0.8.0/24 tag 120
# vrf zone4
# shutdown
- name: Parse externally provided OSPFv2 config
cisco.nxos.nxos_ospfv2:
running_config: "{{ lookup('file', 'ospfv2.cfg') }}"
state: parsed
# Task output:
# ------------
# parsed:
# processes:
# - process_id: "100"
# areas:
# - area_id: 0.0.0.101
# nssa:
# no_redistribution: true
# no_summary: true
# - area_id: 0.0.0.102
# stub:
# no_summary: true
# - area_id: 0.0.0.100
# authentication:
# message_digest: true
# filter_list:
# - direction: out
# route_map: rmap_2
# - direction: in
# route_map: rmap_1
# ranges:
# - not_advertise: true
# prefix: 192.0.2.0/24
# - cost: 120
# prefix: 192.0.3.0/24
# redistribute:
# - protocol: direct
# route_map: ospf-direct-connect
# - id: "120"
# protocol: eigrp
# route_map: rmap_1
# router_id: 192.0.100.1
# vrfs:
# - vrf: zone1
# areas:
# - area_id: 0.0.100.1
# nssa:
# no_redistribution: true
# no_summary: true
# redistribute:
# - protocol: static
# route_map: zone1-direct-connect
# router_id: 192.0.100.2
# summary_address:
# - prefix: 10.0.0.0/24
# tag: 120
# - not_advertise: true
# prefix: 11.0.0.0/24
# - vrf: zone2
# auto_cost:
# reference_bandwidth: 45
# unit: Gbps
# capability:
# vrf_lite:
# evpn: true
# down_bit_ignore: true
# shutdown: true
# - process_id: "102"
# router_id: 198.54.100.1
# shutdown: true
# vrfs:
# - vrf: zone2
# summary_address:
# - prefix: 192.0.8.0/24
# tag: 120
# - vrf: zone4
# shutdown: true
# Using gathered
- name: Gather OSPFv2 facts using gathered
cisco.nxos.nxos_ospfv2:
state: gathered
# Task output:
# ------------
# gathered:
# processes:
# - process_id: "102"
# areas:
# - area_id: 0.0.0.101
# stub:
# no_summary: true
# - area_id: 0.0.0.100
# filter_list:
# - direction: in
# route_map: rmap_8
# ranges:
# - not_advertise: true
# prefix: 198.51.100.64/27
# redistribute:
# - protocol: direct
# route_map: ospf102-direct-connect
# - id: "130"
# protocol: eigrp
# route_map: rmap_1
# router_id: 198.51.100.1
# vrfs:
# - vrf: zone1
# areas:
# - area_id: 0.0.0.102
# nssa:
# default_information_originate: true
# no_summary: true
# redistribute:
# - id: "65563"
# protocol: bgp
# route_map: zone1-bgp-connect
# router_id: 198.51.100.129
#
返回值
常用返回值在此处记录 here,以下是此模块特有的字段
键 |
描述 |
---|---|
生成的配置模型调用。 返回:发生更改时 示例: |
|
模型调用之前的配置。 返回:始终 示例: |
|
推送到远程设备的命令集。 返回:始终 示例: |
|
从远程设备收集的有关网络资源的结构化数据的事实。 返回:当 *state* 为 示例: |
|
根据模块 argspec 将在 *running_config* 选项中提供的设备本机配置解析为结构化数据。 返回:当 *state* 为 示例: |
|
以设备本机格式(脱机)呈现的任务中提供的配置。 返回:当 *state* 为 示例: |