cisco.nxos.nxos_ospfv3 模块 – OSPFv3 资源模块

注意

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

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

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

要在 playbook 中使用它,请指定:cisco.nxos.nxos_ospfv3

cisco.nxos 1.2.0 中的新功能

概要

  • 此模块管理运行 Cisco NX-OS 的设备上的 OSPFv3 配置。

参数

参数

注释

config

字典

OSPFv3 进程配置的列表。

processes

列表 / 元素=字典

OSPFv3 实例配置的列表。

address_family

字典

IPv6 单播地址族 OSPFv3 设置。

afi

字符串

在 IPv6 地址族下配置 OSPFv3 设置。

选项

  • "ipv6"

areas

列表 / 元素=字典

配置地址族下 OSPF 区域的属性。

area_id

字符串 / 必需

IP 地址格式的区域 ID。

default_cost

整数

指定默认成本。

filter_list

列表 / 元素=字典

在 OSPF 区域之间过滤前缀。

direction

字符串 / 必需

应用路由映射的方向。

选项

  • "in"

  • "out"

route_map

字符串 / 必需

路由映射名称。

ranges

列表 / 元素=字典

为区域配置地址范围。

cost

整数

用于范围的成本。

not_advertise

布尔值

禁止通告指定的范围。

选项

  • false

  • true

prefix

字符串 / 必需

前缀格式的 IP (x.x.x.x/len)

default_information

字典

控制默认路由的分配。

originate

字典

分配默认路由。

always

布尔值

始终通告默认路由。

选项

  • false

  • true

route_map

字符串

用于控制默认路由分配的策略

set

布尔值

启用默认路由的分配。

选项

  • false

  • true

distance

整数

配置 OSPF 管理距离。

maximum_paths

整数

每个目标的最大路径数。

redistribute

列表 / 元素=字典

从另一个路由协议重新分配信息。

id

字符串

指定协议的标识符。

protocol

字符串 / 必需

协议的名称。

选项

  • "bgp"

  • "direct"

  • "eigrp"

  • "isis"

  • "lisp"

  • "ospfv3"

  • "rip"

  • "static"

route_map

字符串 / 必需

用于约束重新分配的路由映射策略。

safi

字符串

在 IPv6 单播地址族下配置 OSPFv3 设置。

选项

  • "unicast"

summary_address

列表 / 元素=字典

配置重新分配的路由汇总。

not_advertise

布尔值

禁止通告指定的汇总。

选项

  • false

  • true

prefix

字符串 / 必需

IPv6 前缀格式 ‘xxxx:xxxx/ml’、‘xxxx:xxxx::/ml’ 或 ‘xxxx::xx/128’

tag

整数

32 位标记值。

table_map

字典

用于在将 OSPF 路由发送到 RIB 之前对其进行过滤/修改的策略。

filter

布尔值

阻止 OSPF 路由被发送到 RIB。

选项

  • false

  • true

name

字符串 / 必需

路由映射名称。

timers

字典

配置与计时器相关的常量。

throttle

字典

配置与节流相关的常量。

spf

字典

设置 OSPF SPF 计时器。

initial_spf_delay

整数

初始 SPF 计划延迟(以毫秒为单位)。

max_wait_time

整数

SPF 计算之间的最大等待时间。

min_hold_time

整数

SPF 计算之间的最小保持时间。

areas

列表 / 元素=字典

配置 OSPF 区域的属性。

area_id

字符串 / 必需

IP 地址格式的区域 ID。

nssa

字典

区域的 NSSA 设置。

default_information_originate

布尔值

将 Type-7 默认 LSA 发起到 NSSA 区域中。

选项

  • false

  • true

no_redistribution

布尔值

不要将重新分配的 LSA 发送到 NSSA 区域中。

选项

  • false

  • true

no_summary

布尔值

不要将汇总 LSA 发送到 NSSA 区域中。

选项

  • false

  • true

route_map

字符串

用于控制默认路由分配的策略。

set

布尔值

将区域配置为 NSSA。

选项

  • false

  • true

translate

字典

转换 LSA。

type7

字典

从 Type 7 转换为 Type 5。

always

布尔值

始终转换 LSA

选项

  • false

  • true

never

布尔值

从不转换 LSA

选项

  • false

  • true

supress_fa

布尔值

禁止在转换的 LSA 中转发地址。

选项

  • false

  • true

stub

字典

用于将区域配置为存根的设置。

no_summary

布尔值

阻止 ABR 将汇总 LSA 发送到存根区域中。

选项

  • false

  • true

set

布尔值

将区域配置为存根。

选项

  • false

  • true

auto_cost

字典

根据带宽计算 OSPF 成本。

reference_bandwidth

整数 / 必需

用于分配 OSPF 成本的参考带宽。

unit

字符串 / 必需

指定参考带宽的单位。

选项

  • "Gbps"

  • "Mbps"

flush_routes

布尔值

在非优雅的受控重启时刷新路由。

选项

  • false

  • true

graceful_restart

字典

配置优雅重启。

grace_period

整数

配置优雅重启的最大间隔。

helper_disable

布尔值

启用/禁用辅助模式。

选项

  • false

  • true

planned_only

布尔值

仅为计划的重启启用优雅重启

选项

  • false

  • true

set

布尔值

启用优雅重启。

选项

  • false

  • true

isolate

布尔值

从 OSPF 角度隔离此路由器。

选项

  • false

  • true

log_adjacency_changes

字典

记录邻接状态的更改。

detail

布尔值

通知所有状态更改。

选项

  • false

  • true

log

布尔值

启用/禁用记录邻接状态更改。

选项

  • false

  • true

max_lsa

字典

限制非自身始发的 LSA 数量的功能。

ignore_count

整数

设置可以抑制邻接关系多少次的计数。

ignore_time

整数

设置抑制所有邻接关系的时间。

max_non_self_generated_lsa

整数 / 必需

设置非自身生成的 LSA 的最大数量。

reset_time

整数

设置多少分钟后将忽略计数重置为零。

阈值

整数

生成警告消息的阈值百分比 (%)。

仅警告

布尔值

当超出限制时,记录警告消息。

选项

  • false

  • true

最大指标

字典

最大化成本指标。

路由器 LSA

字典

路由器 LSA 配置。

外部 LSA

字典

外部 LSA 配置。

最大指标值

整数

设置外部 LSA 的最大指标值。

set

布尔值

设置外部 LSA 属性。

选项

  • false

  • true

区域间前缀 LSA

字典

区域间前缀 LSA 配置。

最大指标值

整数

汇总 LSA 的最大指标值。

set

布尔值

设置汇总 LSA 属性。

选项

  • false

  • true

启动时

字典

仅在启动时有效。

set

布尔值

设置启动时属性。

选项

  • false

  • true

等待 BGP ASN

整数

要等待的 BGP 的 ASN。

等待周期

整数

启动后的等待周期(秒)。

set

布尔值

设置路由器 LSA 属性。

选项

  • false

  • true

存根前缀 LSA

布尔值

也为存根链路通告最大指标。

选项

  • false

  • true

名称查找

布尔值

将 OSPF 路由器 ID 显示为 DNS 名称。

选项

  • false

  • true

被动接口

字典

禁止在接口上进行路由更新。

默认

布尔值

默认情况下,接口是被动的。

选项

  • false

  • true

进程 ID

字符串 / 必需

OSPF 进程标签。

路由器 ID

字符串

设置 OSPF 进程路由器 ID。

关闭

布尔值

关闭 OSPF 协议实例。

选项

  • false

  • true

timers

字典

配置与计时器相关的常量。

LSA 到达

整数

LSA 到达之间的最小间隔。

LSA 组步调

整数

LSA 组刷新/最大存活时间间隔。

throttle

字典

配置与节流相关的常量。

LSA

字典

设置 LSA 生成的速率限制。

保持间隔

整数

保持间隔。

最大间隔

整数

最大间隔。

起始间隔

整数

起始间隔。

VRF

列表 / 元素=字典

配置特定于 VRF 的 OSPF 设置。

areas

列表 / 元素=字典

配置 OSPF 区域的属性。

area_id

字符串 / 必需

IP 地址格式的区域 ID。

nssa

字典

区域的 NSSA 设置。

default_information_originate

布尔值

将 Type-7 默认 LSA 发起到 NSSA 区域中。

选项

  • false

  • true

no_redistribution

布尔值

不要将重新分配的 LSA 发送到 NSSA 区域中。

选项

  • false

  • true

no_summary

布尔值

不要将汇总 LSA 发送到 NSSA 区域中。

选项

  • false

  • true

route_map

字符串

用于控制默认路由分配的策略。

set

布尔值

将区域配置为 NSSA。

选项

  • false

  • true

translate

字典

转换 LSA。

type7

字典

从 Type 7 转换为 Type 5。

always

布尔值

始终转换 LSA

选项

  • false

  • true

never

布尔值

从不转换 LSA

选项

  • false

  • true

supress_fa

布尔值

禁止在转换的 LSA 中转发地址。

选项

  • false

  • true

stub

字典

用于将区域配置为存根的设置。

no_summary

布尔值

阻止 ABR 将汇总 LSA 发送到存根区域中。

选项

  • false

  • true

set

布尔值

将区域配置为存根。

选项

  • false

  • true

auto_cost

字典

根据带宽计算 OSPF 成本。

reference_bandwidth

整数 / 必需

用于分配 OSPF 成本的参考带宽。

unit

字符串 / 必需

指定参考带宽的单位。

选项

  • "Gbps"

  • "Mbps"

graceful_restart

字典

配置优雅重启。

grace_period

整数

配置优雅重启的最大间隔。

helper_disable

布尔值

启用/禁用辅助模式。

选项

  • false

  • true

planned_only

布尔值

仅为计划的重启启用优雅重启

选项

  • false

  • true

set

布尔值

启用优雅重启。

选项

  • false

  • true

log_adjacency_changes

字典

记录邻接状态的更改。

detail

布尔值

通知所有状态更改。

选项

  • false

  • true

log

布尔值

启用/禁用记录邻接状态更改。

选项

  • false

  • true

max_lsa

字典

限制非自身始发的 LSA 数量的功能。

ignore_count

整数

设置可以抑制邻接关系多少次的计数。

ignore_time

整数

设置抑制所有邻接关系的时间。

max_non_self_generated_lsa

整数 / 必需

设置非自身生成的 LSA 的最大数量。

reset_time

整数

设置多少分钟后将忽略计数重置为零。

阈值

整数

生成警告消息的阈值百分比 (%)。

仅警告

布尔值

当超出限制时,记录警告消息。

选项

  • false

  • true

最大指标

字典

最大化成本指标。

路由器 LSA

字典

路由器 LSA 配置。

外部 LSA

字典

外部 LSA 配置。

最大指标值

整数

设置外部 LSA 的最大指标值。

set

布尔值

设置外部 LSA 属性。

选项

  • false

  • true

区域间前缀 LSA

字典

区域间前缀 LSA 配置。

最大指标值

整数

汇总 LSA 的最大指标值。

set

布尔值

设置汇总 LSA 属性。

选项

  • false

  • true

启动时

字典

仅在启动时有效。

set

布尔值

设置启动时属性。

选项

  • false

  • true

等待 BGP ASN

整数

要等待的 BGP 的 ASN。

等待周期

整数

启动后的等待周期(秒)。

set

布尔值

设置路由器 LSA 属性。

选项

  • false

  • true

存根前缀 LSA

布尔值

也为存根链路通告最大指标。

选项

  • false

  • true

名称查找

布尔值

将 OSPF 路由器 ID 显示为 DNS 名称。

选项

  • false

  • true

被动接口

字典

禁止在接口上进行路由更新。

默认

布尔值

默认情况下,接口是被动的。

选项

  • false

  • true

路由器 ID

字符串

设置 OSPF 进程路由器 ID。

关闭

布尔值

关闭 OSPF 协议实例。

选项

  • false

  • true

timers

字典

配置与计时器相关的常量。

LSA 到达

整数

LSA 到达之间的最小间隔。

LSA 组步调

整数

LSA 组刷新/最大存活时间间隔。

throttle

字典

配置与节流相关的常量。

LSA

字典

设置 LSA 生成的速率限制。

保持间隔

整数

保持间隔。

最大间隔

整数

最大间隔。

起始间隔

整数

起始间隔。

VRF

字符串 / 必需

VRF 的名称/标识符。

运行配置

字符串

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

此选项的值应该是通过执行命令 show running-config | section “^router ospfv3” 从 NX-OS 设备接收的输出。

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

状态

字符串

配置应保留的状态。

选项

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "gathered"

  • "parsed"

  • "rendered"

注释

注意

  • 针对 NX-OS 7.0(3)I5(1) 进行测试。

  • 不支持 Cisco MDS

  • 此模块适用于连接 network_clihttpapi

示例

# Using merged

# Before state:
# -------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# nxos-9k-rdo#

- name: Merge the provided configuration with the existing running configuration
  cisco.nxos.nxos_ospfv3:
    config:
      processes:
        - process_id: 100
          router_id: 203.0.113.20
        - process_id: 102
          router_id: 198.51.100.1
          address_family:
            afi: ipv6
            safi: unicast
            areas:
              - area_id: 0.0.0.100
                filter_list:
                  - route_map: rmap_1
                    direction: in
                  - route_map: rmap_2
                    direction: out
                ranges:
                  - prefix: '2001:db2::/32'
                    not_advertise: true
                  - prefix: '2001:db3::/32'
                    cost: 120
            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
              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
#  - address-family ipv6 unicast
#  - 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 2001:db2::/32 not-advertise
#  - area 0.0.0.100 range 2001:db3::/32 cost 120
#  - 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
#  - 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
#    - address_family:
#        afi: ipv4
#        safi: unicast
#        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: 2001:db2::/32
#          - cost: 120
#            prefix: 2001:db3::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "120"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      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
#        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 ospfv3"
# router ospfv3 100
#   router-id 203.0.113.20
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family ipv6 unicast
#     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 2001:db2::/32 not-advertise
#     area 0.0.0.100 range 2001:db3::/32 cost 120
#   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
#   vrf zone2
#     auto-cost reference-bandwidth 45 Gbps

# Using replaced

# Before state:
# -------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# router ospfv3 100
#   router-id 203.0.113.20
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family upv6 unicast
#     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 2001:db2::/32 not-advertise
#     area 0.0.0.100 range 2001:db3::/32 cost 120
#   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
#   vrf zone2
#     auto-cost reference-bandwidth 45 Gbps

- name: Replace device configurations of listed OSPFv3 processes with provided configurations
  cisco.nxos.nxos_ospfv3:
    config:
      processes:
        - process_id: 102
          router_id: 198.51.100.1
          address_family:
            afi: ipv6
            safi: unicast
            areas:
              - area_id: 0.0.0.100
                filter_list:
                  - route_map: rmap_8
                    direction: in
                ranges:
                  - not_advertise: true
                    prefix: 2001:db2::/32
            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
              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
#    - address_family:
#        afi: ipv4
#        safi: unicast
#        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: 2001:db2::/32
#          - cost: 120
#            prefix: 2001:db3::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "120"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      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
#        router_id: 198.51.100.129
#        vrf: zone1
#      - auto_cost:
#          reference_bandwidth: 45
#          unit: Gbps
#        vrf: zone2
#
#  commands:
#  - router ospf 102
#  - address-family ipv6 unicast
#  - 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 2001:db3::/32
#  - vrf zone1
#  - 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
#    - address_family:
#        afi: ipv6
#        safi: unicast
#        areas:
#        - area_id: 0.0.0.100
#          filter_list:
#          - direction: in
#            route_map: rmap_8
#          ranges:
#          - not_advertise: true
#            prefix: 2001:db2::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "130"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      router_id: 198.51.100.1
#      vrfs:
#      - areas:
#        - area_id: 0.0.0.102
#          nssa:
#            default_information_originate: true
#            no_summary: true
#        router_id: 198.51.100.129
#        vrf: zone1

# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# router ospfv3 100
#   router-id 203.0.113.20
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family ipv6 unicast
#     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

# Using overridden

# Before state:
# -------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# router ospfv3 100
#   router-id 203.0.113.20
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family ipv6 unicast
#     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 2001:db2::/32 not-advertise
#     area 0.0.0.100 range 2001:db3::/32 cost 120
#   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
#   vrf zone2
#     auto-cost reference-bandwidth 45 Gbps

- name: Override all OSPFv3 configuration with provided configuration
  cisco.nxos.nxos_ospfv3:
    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
#    - address_family:
#        afi: ipv4
#        safi: unicast
#        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: 2001:db2::/32
#          - cost: 120
#            prefix: 2001:db3::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "120"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      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
#        router_id: 198.51.100.129
#        vrf: zone1
#      - auto_cost:
#          reference_bandwidth: 45
#          unit: Gbps
#        vrf: zone2
#
# commands:
#  - no router ospfv3 100
#  - router ospfv3 104
#  - router-id 203.0.113.20
#  - router ospfv3 102
#  - shutdown
#  - address-family ipv6 unicast
#  - 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 2001:db2::/32
#  - no area 0.0.0.100 range 2001:db3::/32
#  - no vrf zone1
#  - no vrf zone2
#
# after:
#    processes:
#    - process_id: "102"
#      router_id: 198.51.100.1
#      shutdown: true
#      address_family:
#        afi: ipv6
#        safi: unicast
#    - process_id: "104"
#      router_id: 203.0.113.20

# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family ipv6 unicast
#   shutdown
# router ospfv3 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 ospfv3 100
#   router-id 203.0.113.20
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family ipv6 unicast
#     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 2001:db2::/32 not-advertise
#     area 0.0.0.100 range 2001:db3::/32 cost 120
#   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
#   vrf zone2
#     auto-cost reference-bandwidth 45 Gbps

- name: Delete a single OSPFv3 process
  cisco.nxos.nxos_ospfv3:
    config:
      processes:
        - process_id: 102
    state: deleted

# Task output:
# ------------
# before:
#    processes:
#    - process_id: "100"
#      router_id: 203.0.113.20
#    - address_family:
#        afi: ipv4
#        safi: unicast
#        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: 2001:db2::/32
#          - cost: 120
#            prefix: 2001:db3::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "120"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      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
#        router_id: 198.51.100.129
#        vrf: zone1
#      - auto_cost:
#          reference_bandwidth: 45
#          unit: Gbps
#        vrf: zone2
#
# commands:
#   - no router ospfv3 102
#
# after:
#   processes:
#   - process_id: "100"
#     router_id: 203.0.113.20

# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# router ospfv3 100
#   router-id 203.0.113.20

# Using deleted all OSPFv3 processes from the device

# Before state:
# -------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# router ospfv3 100
#   router-id 203.0.113.20
# router ospfv3 102
#   router-id 198.51.100.1
#   address-family ipv6 unicast
#     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 2001:db2::/32 not-advertise
#     area 0.0.0.100 range 2001:db3::/32 cost 120
#   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
#   vrf zone2
#     auto-cost reference-bandwidth 45 Gbps

- name: Delete all OSPFv3 processes from the device
  cisco.nxos.nxos_ospfv3:
    state: deleted

# Task output:
# ------------
# before:
#    processes:
#    - process_id: "100"
#      router_id: 203.0.113.20
#    - address_family:
#        afi: ipv4
#        safi: unicast
#        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: 2001:db2::/32
#          - cost: 120
#            prefix: 2001:db3::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "120"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      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
#        router_id: 198.51.100.129
#        vrf: zone1
#      - auto_cost:
#          reference_bandwidth: 45
#          unit: Gbps
#        vrf: zone2
#
# commands:
#  - no router ospfv3 100
#  - no router ospfv3 102
#
#  after: {}

# After state:
# ------------
# nxos-9k-rdo# sh running-config | section "^router ospfv3"
# nxos-9k-rdo#

# Using rendered

- name: Render platform specific configuration lines with state rendered (without connecting to the device)
  cisco.nxos.nxos_ospfv3:
    config:
      processes:
        - process_id: 100
          router_id: 203.0.113.20
        - process_id: 102
          router_id: 198.51.100.1
          address_family:
            afi: ipv6
            safi: unicast
            areas:
              - area_id: 0.0.0.100
                filter_list:
                  - route_map: rmap_1
                    direction: in
                  - route_map: rmap_2
                    direction: out
                ranges:
                  - prefix: 2001:db2::/32
                    not_advertise: true
                  - prefix: 2001:db3::/32
                    cost: 120
            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
              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 ospfv3 100
#  - router-id 203.0.113.20
#  - router ospfv3 102
#  - router-id 198.51.100.1
#  - address-family ipv6 unicast
#  - 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 2001:db2::/32 not-advertise
#  - area 0.0.0.100 range 2001:db3::/32 cost 120
#  - 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
#  - vrf zone2
#  - auto-cost reference-bandwidth 45 Gbps

# Using parsed

# parsed.cfg
# ------------
# router ospfv3 100
#   router-id 192.0.100.1
#   address-family ipv6 unicast
#     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 2001:db2::/32 not-advertise
#     area 0.0.0.100 range 2001:db3::/32 cost 120
#   vrf zone1
#     router-id 198.51.100.129
#     area 0.0.100.1 nssa no-summary no-redistribution
# router ospfv3 102
#   router-id 198.54.100.1
#   shutdown

- name: Parse externally provided OSPFv3 config
  cisco.nxos.nxos_ospfv3:
    running_config: "{{ lookup('file', 'ospfv2.cfg') }}"
    state: parsed

# Task output:
# ------------
# parsed:
#   processes:
#   - process_id: "100"
#     address_family:
#       afi: ipv6
#       safi: unicast
#       areas:
#       - area_id: 0.0.0.101
#         nssa:
#           no_redistribution: true
#           no_summary: true
#       - area_id: 0.0.0.102
#         stub:
#           no_summary: 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
#         router_id: 192.0.100.2
#   - process_id: "102"
#     router_id: 198.54.100.1
#     shutdown: true

# Using gathered

- name: Gather OSPFv3 facts using gathered
  cisco.nxos.nxos_ospfv3:
    state: gathered

# Task output:
# ------------
#  gathered:
#    processes:
#    - process_id: "100"
#      router_id: 203.0.113.20
#    - address_family:
#        afi: ipv4
#        safi: unicast
#        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: 2001:db2::/32
#          - cost: 120
#            prefix: 2001:db3::/32
#        redistribute:
#        - protocol: direct
#          route_map: ospf102-direct-connect
#        - id: "120"
#          protocol: eigrp
#          route_map: rmap_1
#      process_id: "102"
#      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
#        router_id: 198.51.100.129
#        vrf: zone1
#      - auto_cost:
#          reference_bandwidth: 45
#          unit: Gbps
#        vrf: zone2
#

返回值

通用返回值记录在此处,以下是此模块特有的字段

描述

之后

字典

生成的配置模型调用。

返回: 当更改时

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

之前

字典

模型调用之前的配置。

返回: 始终

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

命令

列表 / elements=字符串

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

返回: 始终

示例: ["router ospfv3 102", "router-id 198.54.100.1", "router ospfv3 100", "router-id 192.0.100.1", "address-family ipv6 unicast", "redistribute eigrp 120 route-map rmap_1", "redistribute direct route-map ospf-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 2001:db2::/32 not-advertise", "area 0.0.0.100 range 2001:db3::/32 cost 120", "vrf zone1", "router-id 192.0.100.2", "vrf zone2", "auto-cost reference-bandwidth 45 Gbps"]

已收集

字典

从远程设备收集的关于网络资源的结构化数据的事实。

返回:stategathered

示例: "此输出将始终采用与模块 argspec 相同的格式。\n"

已解析

字典

running_config 选项中提供的设备原生配置,根据模块 argspec 解析为结构化数据。

返回:stateparsed

示例: "此输出将始终采用与模块 argspec 相同的格式。\n"

已渲染

列表 / elements=字符串

任务中提供的配置以设备原生格式渲染(离线)。

返回:staterendered

示例: ["router ospfv3 102", "router-id 198.54.100.1", "router ospfv3 100"]

作者

  • Nilashish Chakraborty (@NilashishC)