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 设置。 | |
| 将类型 7 默认 LSA 传播到 NSSA 区域。 选项 
 | |
| 不要将重新分发的 LSA 发送到 NSSA 区域。 选项 
 | |
| 不要将汇总 LSA 发送到 NSSA 区域。 选项 
 | |
| 将区域配置为 NSSA。 选项 
 | |
| 转换 LSA。 | |
| 将类型 7 转换为类型 5。 | |
| 始终转换 LSA 选项 
 | |
| 从不转换 LSA 选项 
 | |
| 在转换后的 LSA 中禁止转发地址。 选项 
 | |
| 为区域配置地址范围。 | |
| 要用于范围的开销。 | |
| 禁止通告指定的范围。 选项 
 | |
| IP 前缀格式 (x.x.x.x/len) | |
| 将区域配置为存根区域的设置。 | |
| 阻止 ABR 将汇总 LSA 发送到存根区域。 选项 
 | |
| 将区域配置为存根区域。 选项 
 | |
| 根据带宽计算 OSPF 开销。 | |
| 用于分配 OSPF 开销的参考带宽。 | |
| 指定参考带宽的单位。 选项 
 | |
| 在所有 OSPF 接口上启用 BFD。 选项 
 | |
| 控制默认路由的分发。 | |
| 分发默认路由。 | |
| 始终通告默认路由。 选项 
 | |
| 控制默认路由分发的策略 | |
| 启用默认路由的分发。 选项 
 | |
| 指定重新分发路由的默认度量。 | |
| 配置 OSPF 管理距离。 | |
| 在非优雅受控重启时刷新路由。 选项 
 | |
| 配置优雅重启。 | |
| 配置优雅重启的最大间隔。 | |
| 启用/禁用辅助模式。 选项 
 | |
| 启用优雅重启。 选项 
 | |
| 从 OSPF 的角度隔离此路由器。 选项 
 | |
| 记录邻接状态的更改。 | |
| 通知所有状态更改。 选项 
 | |
| 启用/禁用记录邻接状态的更改。 选项 
 | |
| 限制非自身生成的 LSA 数量的功能。 | |
| 设置邻接可以被抑制的次数。 | |
| 设置所有邻接都被抑制的时间。 | |
| 设置非自身生成的 LSA 的最大数量。 | |
| 设置忽略计数重置为零的分钟数。 | |
| 生成警告消息的阈值 (%)。 | |
| 超过限制时记录警告消息。 选项 
 | |
| 最大化开销度量。 | |
| 路由器 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 协议实例。 选项 
 | |
| 配置重新分发的路由汇总。 | |
| 禁止通告指定的汇总。 选项 
 | |
| IP 前缀,格式为 x.x.x.x/ml。 | |
| 一个 32 位的标签值。 | |
| 在将 OSPF 路由发送到 RIB 之前,用于过滤/修改 OSPF 路由的策略。 | |
| 阻止将 OSPF 路由发送到 RIB。 选项 
 | |
| 路由策略名称。 | |
| 配置与计时器相关的常量。 | |
| LSA 到达之间的最小间隔。 | |
| LSA 组刷新/最大生存时间间隔。 | |
| 配置与限速相关的常量。 | |
| 设置 LSA 生成的速率限制。 | |
| 保持时间间隔。 | |
| 最大时间间隔。 | |
| 起始时间间隔。 | |
| 设置 OSPF SPF 计时器。 | |
| 初始 SPF 调度延迟(毫秒)。 | |
| SPF 计算之间最大等待时间。 | |
| SPF 计算之间最小保持时间。 | |
| 配置特定于 VRF 的 OSPF 设置。 | |
| 配置 OSPF 区域的属性。 | |
| 以 IP 地址格式表示的区域 ID。 | |
| 区域的认证设置。 | |
| 使用消息摘要认证。 选项 
 | |
| 设置区域的认证。 选项 
 | |
| 指定默认汇总 LSA 的默认开销。 | |
| 过滤 OSPF 区域之间的前缀。 | |
| 应用路由映射的方向。 选项 
 | |
| 路由映射名称。 | |
| 区域的 NSSA 设置。 | |
| 将类型 7 默认 LSA 传播到 NSSA 区域。 选项 
 | |
| 不要将重新分发的 LSA 发送到 NSSA 区域。 选项 
 | |
| 不要将汇总 LSA 发送到 NSSA 区域。 选项 
 | |
| 将区域配置为 NSSA。 选项 
 | |
| 转换 LSA。 | |
| 将类型 7 转换为类型 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 的最大数量。 | |
| 设置忽略计数重置为零的分钟数。 | |
| 生成警告消息的阈值 (%)。 | |
| 超过限制时记录警告消息。 选项 
 | |
| 最大化开销度量。 | |
| 路由器 LSA 配置。 | |
| 外部 LSA 配置。 | |
| 设置外部 LSA 的最大度量值。 | |
| 设置 external-lsa 属性。 选项 
 | |
| 也为存根链路通告最大度量。 选项 
 | |
| 仅在启动时有效。 | |
| 设置 on-startup 属性。 选项 
 | |
| 要等待的 BGP ASN。 | |
| 启动后等待的秒数。 | |
| 设置 router-lsa 属性。 选项 
 | |
| 汇总 LSA 配置。 | |
| 汇总 LSA 的最大度量值。 | |
| 设置 summary-lsa 属性。 选项 
 | |
| 每个目的地的最大路径数。 | |
| 将 OSPF 路由器 ID 显示为 DNS 名称。 选项 
 | |
| 禁止在接口上进行路由更新。 | |
| 默认情况下接口处于被动状态。 选项 
 | |
| 重新分发来自其他路由协议的信息。 | |
| 指定协议的标识符。 | |
| 协议的名称。 选项 
 | |
| 用于限制重新分发的路由策略。 | |
| 为外部路径首选项配置 1583 兼容性。 选项 
 | |
| 设置 OSPF 进程路由器 ID。 | |
| 关闭 OSPF 协议实例。 选项 
 | |
| 配置重新分发的路由汇总。 | |
| 禁止通告指定的汇总。 选项 
 | |
| IP 前缀,格式为 x.x.x.x/ml。 | |
| 一个 32 位的标签值。 | |
| 在将 OSPF 路由发送到 RIB 之前,用于过滤/修改 OSPF 路由的策略。 | |
| 阻止将 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
#
返回值
常用的返回值已在此处记录,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 生成的配置模型调用。 返回:发生更改时 示例:  | |
| 模型调用之前的配置。 返回:始终返回 示例:  | |
| 推送到远程设备的命令集。 返回:始终返回 示例:  | |
| 从远程设备收集到的关于网络资源的事实,以结构化数据的形式呈现。 返回:当 *state* 为  示例:  | |
| 根据模块 argspec 将 *running_config* 选项中提供的设备原生配置解析为结构化数据。 返回:当 *state* 为  示例:  | |
| 以设备原生格式(离线)呈现的任务中提供的配置。 返回:当 *state* 为  示例:  | 
