arista.eos.eos_ospfv3 模块 – OSPFv3 资源模块

注意

此模块是 arista.eos 集合(版本 10.0.1)的一部分。

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

要安装它,请使用:ansible-galaxy collection install arista.eos

要在 playbook 中使用它,请指定:arista.eos.eos_ospfv3

arista.eos 1.1.0 新增功能

概要

  • 此模块在 Arista EOS 平台上配置和管理 ospfv3 的属性。

参数

参数

注释

config

字典

ospfv3 的配置列表。

processes

列表 / 元素=字典

指定 ospfv3 进程的字典列表。

address_family

列表 / 元素=字典

启用地址族并进入其配置模式

adjacency

字典

为 OSPF 实例配置邻接选项。

exchange_start

字典

为 OSPF 实例配置交换启动选项。

threshold

整数

要同时启动的对等体数量。

afi

字符串

地址族。

选项

  • "ipv4"

  • "ipv6"

areas

列表 / 元素=字典

指定 OSPF 区域的配置

area_id

字符串

指定一个以十进制或点分十进制表示的 32 位数字。

authentication

字典

为 ospfv3 的区域配置身份验证。

algorithm

字符串

要使用的算法名称。

选项

  • "md5"

  • "sha1"

encrypt_key

布尔值

如果为 false,则密钥字符串不会被加密

选项

  • false

  • true

hidden_key

布尔值

如果为 true,则指定后面跟随一个隐藏的密钥。

选项

  • false

  • true

key

字符串

128 位 MD5 密钥或 140 位 SHA1 密钥。

passphrase

字符串

用于派生身份验证和加密密钥的密码字符串。

spi

整数

指定 SPI 值

default_cost

整数

指定 stub/NSSA 区域中默认汇总路由的成本。

encryption

字典

为区域配置加密

algorithm

字符串

要使用的算法名称。

选项

  • "sha1"

  • "md5"

encrypt_key

布尔值

如果为 false,则密钥字符串不会被加密

选项

  • false

  • true

encryption

字符串

要使用的加密名称。

选项

  • "3des-cbc"

  • "aes-128-cbc"

  • "aes-192-cbc"

  • "aes-256-cbc"

  • "null"

hidden_key

布尔值

如果为 true,则指定后面跟随一个隐藏的密钥。

选项

  • false

  • true

key

字符串

128 位 MD5 密钥或 140 位 SHA1 密钥。

passphrase

字符串

用于派生身份验证和加密密钥的密码字符串。

spi

整数

指定 SPI 值

nssa

字典

配置 NSSA 参数。

default_information_originate

字典

始发默认类型 7 LSA。

metric

整数

默认路由的指标。

metric_type

整数

默认路由的指标类型。

nssa_only

布尔值

将默认通告限制为此 NSSA 区域。

选项

  • false

  • true

set

布尔值

如果仅设置了默认信息始发,则为 true

选项

  • false

  • true

no_summary

布尔值

过滤 nssa 区域中的所有类型 3 LSA。

选项

  • false

  • true

nssa_only

布尔值

禁用类型 7 LSA p 位设置

选项

  • false

  • true

set

布尔值

如果仅设置了 nssa,则为 true

选项

  • false

  • true

translate

布尔值

启用 LSA 转换。

选项

  • false

  • true

ranges

列表 / 元素=字典

配置路由汇总。

address

字符串

IP 地址。

advertise

布尔值

启用范围的通告。

选项

  • false

  • true

cost

整数

配置指标。

subnet_address

字符串

带有掩码长度的 IP 地址

subnet_mask

字符串

IP 子网掩码

stub

字典

存根区域。

set

布尔值

如果仅设置了存根,则为 true

选项

  • false

  • true

summary_lsa

布尔值

如果为 false,则过滤存根区域中的所有类型 3 LSA。

选项

  • false

  • true

auto_cost

字典

设置自动成本。

reference_bandwidth

整数

参考带宽,单位为兆比特/秒。

bfd

字典

启用 BFD。

all_interfaces

布尔值

在所有接口上启用 BFD。

选项

  • false

  • true

default_information

字典

控制默认信息的分配。

always

布尔值

始终通告默认路由。

选项

  • false

  • true

metric

整数

默认路由的指标。

metric_type

整数

默认路由的指标类型。

originate

布尔值

分配默认路由。

选项

  • false

  • true

route_map

字符串

指定要使用的路由图。

default_metric

整数

配置重新分配路由的默认指标。

distance

整数

指定路由的管理距离。

fips_restrictions

布尔值

使用符合 FIPS 标准的算法

选项

  • false

  • true

graceful_restart

字典

启用优雅重启模式。

grace_period

整数

指定等待优雅重启完成的最大时间。

set

布尔值

如果为 true,则仅设置 grace_fulrestart 配置。

选项

  • false

  • true

graceful_restart_helper

布尔值

如果为 true,则启用优雅重启帮助程序。

选项

  • false

  • true

log_adjacency_changes

字典

配置 OSPFv3 邻居的链路状态更改和转换。

detail

布尔值

如果为 true,则配置交换机以记录所有链路状态更改。

选项

  • false

  • true

set

布尔值

如果为 true,则仅设置 log_adjacency_changes 配置。

选项

  • false

  • true

max_metric

字典

设置最大指标。

router_lsa

字典

在自身始发的路由器 LSA 中的最大指标。

external_lsa

字典

使用最大指标值覆盖外部 LSA 指标。

max_metric_value

整数

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

set

布尔值

设置外部 LSA 属性。

选项

  • false

  • true

include_stub

布尔值

为路由器 LSA 中的存根链路设置最大指标。

选项

  • false

  • true

on_startup

字典

在重新启动后临时设置最大指标。

wait_for_bgp

布尔值

让 BGP 决定何时以正常指标始发路由器 LSA

选项

  • false

  • true

wait_period

整数

启动后等待的时间(以秒为单位)。

set

布尔值

设置路由器 LSA 属性。

选项

  • false

  • true

summary_lsa

字典

使用最大指标值覆盖汇总 LSA 指标。

max_metric_value

整数

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

set

布尔值

设置外部 LSA 属性。

选项

  • false

  • true

maximum_paths

整数

ECMP 路由中的最大下一跳数。

passive_interface

布尔值

包括接口,但未主动运行 OSPF。

选项

  • false

  • true

redistribute

列表 / 元素=字典

指定要重新分配的路由。

route_map

字符串

指定要使用的路由图。

routes

字符串

路由类型(BGP、静态、已连接)

选项

  • "bgp"

  • "connected"

  • "static"

router_id

字符串

分配给运行 OSPFv3 的路由器的 32 位数字。

shutdown

布尔值

禁用 OSPF 实例。

选项

  • false

  • true

timers

字典

配置 OSPF 计时器。

lsa

任何

配置 OSPFv3 LSA 计时器。

direction

字符串

配置 OSPFv3 LSA 接收/传输计时器。

选项

  • "rx"

  • "tx"

initial

整数

初始 SPF 计划延迟(毫秒)。

max

整数

两个 SPF 之间的最大等待时间(毫秒)。

min

整数

两个 SPF 之间的最小保持时间(毫秒)

out_delay

整数

配置 out-delay 计时器。

pacing

整数

配置 OSPF 数据包步调。

spf

字典

配置 OSPFv3 spf 计时器。

initial

整数

初始 SPF 计划延迟(毫秒)。

max

整数

两个 SPF 之间的最大等待时间(毫秒)。

min

整数

两个 SPF 之间的最小保持时间(毫秒)

adjacency

字典

为 OSPF 实例配置邻接选项。

exchange_start

字典

为 OSPF 实例配置交换启动选项。

threshold

整数

要同时启动的对等体数量。

areas

列表 / 元素=字典

指定 OSPF 区域的配置

area_id

字符串

指定一个以十进制或点分十进制表示的 32 位数字。

authentication

字典

为 ospfv3 的区域配置身份验证。

algorithm

字符串

要使用的算法名称。

选项

  • "md5"

  • "sha1"

encrypt_key

布尔值

如果为 false,则密钥字符串不会被加密

选项

  • false

  • true

hidden_key

布尔值

如果为 true,则指定后面跟随一个隐藏的密钥。

选项

  • false

  • true

key

字符串

128 位 MD5 密钥或 140 位 SHA1 密钥。

passphrase

字符串

用于派生身份验证和加密密钥的密码字符串。

spi

整数

指定 SPI 值

default_cost

整数

指定 stub/NSSA 区域中默认汇总路由的成本。

encryption

字典

为区域配置加密

algorithm

字符串

要使用的算法名称。

选项

  • "sha1"

  • "md5"

encrypt_key

布尔值

如果为 false,则密钥字符串不会被加密

选项

  • false

  • true

encryption

字符串

要使用的加密名称。

选项

  • "3des-cbc"

  • "aes-128-cbc"

  • "aes-192-cbc"

  • "aes-256-cbc"

  • "null"

hidden_key

布尔值

如果为 true,则指定后面跟随一个隐藏的密钥。

选项

  • false

  • true

key

字符串

128 位 MD5 密钥或 140 位 SHA1 密钥。

passphrase

字符串

用于派生身份验证和加密密钥的密码字符串。

spi

整数

指定 SPI 值

nssa

字典

配置 NSSA 参数。

default_information_originate

字典

始发默认类型 7 LSA。

metric

整数

默认路由的指标。

metric_type

整数

默认路由的指标类型。

nssa_only

布尔值

将默认通告限制为此 NSSA 区域。

选项

  • false

  • true

set

布尔值

如果仅设置了默认信息始发,则为 true

选项

  • false

  • true

no_summary

布尔值

过滤 nssa 区域中的所有类型 3 LSA。

选项

  • false

  • true

nssa_only

布尔值

禁用类型 7 LSA p 位设置

选项

  • false

  • true

set

布尔值

如果仅设置了 nssa,则为 true

选项

  • false

  • true

translate

布尔值

启用 LSA 转换。

选项

  • false

  • true

stub

字典

存根区域。

set

布尔值

如果仅设置了存根,则为 true。

选项

  • false

  • true

summary_lsa

布尔值

如果为 false,则过滤存根区域中的所有类型 3 LSA。

选项

  • false

  • true

auto_cost

字典

设置自动成本。

reference_bandwidth

整数

参考带宽,单位为兆比特/秒。

bfd

字典

启用 BFD。

all_interfaces

布尔值

在所有接口上启用 BFD。

选项

  • false

  • true

fips_restrictions

布尔值

使用符合 FIPS 标准的算法

选项

  • false

  • true

graceful_restart

字典

启用优雅重启模式。

grace_period

整数

指定等待优雅重启完成的最大时间。

set

布尔值

如果为 true,则仅设置 grace_fulrestart 配置。

选项

  • false

  • true

graceful_restart_helper

布尔值

如果为 true,则启用优雅重启帮助程序。

选项

  • false

  • true

log_adjacency_changes

字典

配置 OSPFv3 邻居的链路状态更改和转换。

detail

布尔值

如果为 true,则配置交换机以记录所有链路状态更改。

选项

  • false

  • true

set

布尔值

如果为 true,则仅设置 log_adjacency_changes 配置。

选项

  • false

  • true

max_metric

字典

设置最大指标。

router_lsa

字典

在自身始发的路由器 LSA 中的最大指标。

external_lsa

字典

使用最大指标值覆盖外部 LSA 指标。

max_metric_value

整数

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

set

布尔值

设置外部 LSA 属性。

选项

  • false

  • true

include_stub

布尔值

为路由器 LSA 中的存根链路设置最大指标。

选项

  • false

  • true

on_startup

字典

在重新启动后临时设置最大指标。

wait_for_bgp

布尔值

让 BGP 决定何时以正常指标始发路由器 LSA

选项

  • false

  • true

wait_period

整数

启动后等待的时间(以秒为单位)。

set

布尔值

设置路由器 LSA 属性。

选项

  • false

  • true

summary_lsa

字典

使用最大指标值覆盖汇总 LSA 指标。

max_metric_value

整数

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

set

布尔值

设置外部 LSA 属性。

选项

  • false

  • true

passive_interface

布尔值

包括接口,但未主动运行 OSPF。

选项

  • false

  • true

router_id

字符串

分配给运行 OSPFv3 的路由器的 32 位数字。

shutdown

布尔值

禁用 OSPF 实例。

选项

  • false

  • true

timers

字典

配置 OSPF 计时器。

lsa

任何

配置 OSPFv3 LSA 计时器。

direction

字符串

配置 OSPFv3 LSA 接收/传输计时器。

选项

  • "rx"

  • "tx"

initial

整数

初始 SPF 计划延迟(毫秒)。

max

整数

两个 SPF 之间的最大等待时间(毫秒)。

min

整数

两个 SPF 之间的最小保持时间(毫秒)

out_delay

整数

配置 out-delay 计时器。

pacing

整数

配置 OSPF 数据包步调。

spf

字典

配置 OSPFv3 spf 计时器。

initial

整数

初始 SPF 计划延迟(毫秒)。

max

整数

两个 SPF 之间的最大等待时间(毫秒)。

min

整数

两个 SPF 之间的最小保持时间(毫秒)

vrf

字符串

VRF 名称。

running_config

字符串

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

此选项的值应是通过执行命令 **show running-config | section ospfv3** 从 EOS 设备接收的输出。

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

state

字符串

配置应保持的状态。

选项

  • "deleted"

  • "merged" ←(默认)

  • "overridden"

  • "replaced"

  • "gathered"

  • "rendered"

  • "已解析"

注释

注意

  • 已在 Arista EOS 4.24.6F 版本上测试。

  • 此模块使用连接 network_cli。请参阅 EOS 平台选项

示例

# Using merged

# Before state:
# -------------
# veos#show running-config | section ospfv3
# veos#

- name: Merge the provided configuration with the existing running configuration
  arista.eos.eos_ospfv3:
    config:
      processes:
        - address_family:
            - timers:
                lsa: 22
              graceful_restart:
                grace_period: 35
              afi: "ipv6"
          timers:
            pacing: 55
          fips_restrictions: true
          router_id: "2.2.2.2"
          vrf: "vrfmerge"
    state: merged


# Task output:
# ------------
# before: {}
#
# commands:
# - router ospfv3 vrf vrfmerge
# - address-family ipv6
# - graceful-restart grace-period 35
# - timers lsa arrival 22
# - exit
# - timers pacing flood 55
# - fips restrictions
# - router-id 2.2.2.2
# - exit
#
# after:
#     processes:
#     - address_family:
#       - afi: ipv6
#         fips_restrictions: true
#         graceful_restart:
#           grace_period: 35
#       fips_restrictions: true
#       router_id: 2.2.2.2
#       timers:
#         pacing: 55
#       vrf: vrfmerge

# After state:
# ------------
# veos#show running-config | section ospfv3
# router ospfv3 vrf vrfmerge
#    router-id 2.2.2.2
# test
#    fips restrictions
#    timers pacing flood 55
#    !
#    address-family ipv6
#       fips restrictions
#       timers lsa arrival 22
#       graceful-restart grace-period 35

# using replaced

# Before state:
# -------------
# veos#show running-config | section ospfv3
# router ospfv3
#    fips restrictions
#    area 0.0.0.0 encryption ipsec spi 43 esp null md5 passphrase 7 h8pZp9eprTYjjoY/NKFFe0Ei7x03Y7dyLotRhI0a5t4=
# !
# router ospfv3 vrf vrfmerge
#    router-id 2.2.2.2
#    fips restrictions
#    timers pacing flood 55
#    !
#    address-family ipv6
#       fips restrictions
#       timers lsa arrival 22
#       graceful-restart grace-period 35

- name: Replace a section of running config with provided config
  arista.eos.eos_ospfv3:
    config:
      processes:
        - areas:
            - area_id: "0.0.0.0"
              encryption:
                spi: 43
                encryption: "null"
                algorithm: "md5"
                encrypt_key: false
                passphrase: "7hl8FV3lZ6H1mAKpjL47hQ=="
          vrf: "default"
          address_family:
            - afi: "ipv4"
              router_id: "7.1.1.1"
    state: replaced

# Task output:
# ------------
# before:
#     processes:
#     - areas:
#       - area_id: 0.0.0.0
#         encryption:
#           algorithm: md5
#           encryption: 'null'
#           hidden_key: true
#           passphrase: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
#           spi: 43
#       fips_restrictions: true
#       vrf: default
#     - address_family:
#       - afi: ipv6
#         fips_restrictions: true
#         graceful_restart:
#           grace_period: 35
#       fips_restrictions: true
#       router_id: 2.2.2.2
#       timers:
#         pacing: 55
#       vrf: vrfmerge
#
# commands:
# - router ospfv3 vrf vrfmerge
# - address-family ipv6
# - no fips restrictions
# - no graceful-restart
# - no timers lsa arrival 22
# - area 0.0.0.3 range 10.1.2.2/24 advertise
# - area 0.0.0.3 range 60.1.1.1 255.255.0.0 cost 30
# - exit
# - passive-interface default
# - no router-id
# - no fips restrictions
# - no timers pacing flood 55
# - exit
#
# after:
#     processes:
#     - areas:
#       - area_id: 0.0.0.0
#         encryption:
#           algorithm: md5
#           encryption: 'null'
#           hidden_key: true
#           passphrase: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
#           spi: 43
#       vrf: default
#     - address_family:
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#       passive_interface: true
#       vrf: vrfmerge

# After state:
# ------------
# veos#show running-config | section ospfv3
# router ospfv3
#    area 0.0.0.0 encryption ipsec spi 43 esp null md5 passphrase 7 h8pZp9eprTYjjoY/NKFFe0Ei7x03Y7dyLotRhI0a5t4=
# !
# router ospfv3 vrf vrfmerge
#    passive-interface default
#    !
#    address-family ipv6
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30

# using overridden

# Before state:
# -------------
# veos#show running-config | section ospfv3
# router ospfv3
#    area 0.0.0.0 encryption ipsec spi 43 esp null md5 passphrase 7 h8pZp9eprTYjjoY/NKFFe0Ei7x03Y7dyLotRhI0a5t4=
# !
# router ospfv3 vrf vrfmerge
#    passive-interface default
#    !
#    address-family ipv6
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30

- name: Override running config with provided config
  arista.eos.eos_ospfv3:
    config:
      processes:
        - address_family:
            - areas:
                - area_id: "0.0.0.3"
                  ranges:
                    - address: 10.1.2.2/24
                      advertise: true
                    - address: 60.1.1.1
                      subnet_mask: 255.255.0.0
                      cost: 30
              afi: "ipv6"
          passive_interface: true
          vrf: "vrfmerge"
    state: overridden

# Task output:
# ------------
# before:
#     processes:
#     - areas:
#       - area_id: 0.0.0.0
#         encryption:
#           algorithm: md5
#           encryption: 'null'
#           hidden_key: true
#           passphrase: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
#           spi: 43
#       vrf: default
#     - address_family:
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#       passive_interface: true
#       vrf: vrfmerge
#
# commands:
# - no router ospfv3
# - router ospfv3 vrf vrfmerge
# - address-family ipv6
# - no area 0.0.0.3 range 10.1.2.0/24
# - no area 0.0.0.3 range 60.1.0.0/16 cost 30
# - area 0.0.0.3 range 10.1.2.2/24 advertise
# - area 0.0.0.3 range 60.1.1.1 255.255.0.0 cost 30
# - exit
# - exit
#
# after:
#     processes:
#     - address_family:
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#       passive_interface: true
#       vrf: vrfmerge

# After state:
# ------------
# veos#show running-config | section ospfv3
# router ospfv3 vrf vrfmerge
#    passive-interface default
#    !
#    address-family ipv6
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30

# using deleted

# Before state:
# -------------
# veos#show running-config | section ospfv3
# router ospfv3
#    area 0.0.0.0 encryption ipsec spi 43 esp null md5 passphrase 7 h8pZp9eprTYjjoY/NKFFe0Ei7x03Y7dyLotRhI0a5t4=
# !
# router ospfv3 vrf vrfmerge
#    passive-interface default
#    !
#    address-family ipv4
#       redistribute connected
#       redistribute static route-map MAP01
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30
#    !
#    address-family ipv6
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30

- name: Delete OSPFv3 config
  arista.eos.eos_ospfv3:
    config:
    state: deleted

# Task output:
# ------------

# before:
#     processes:
#     - areas:
#       - area_id: 0.0.0.0
#         encryption:
#           algorithm: md5
#           encryption: 'null'
#           hidden_key: true
#           passphrase: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
#           spi: 43
#       vrf: default
#     - address_family:
#       - afi: ipv4
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#         redistribute:
#         - routes: connected
#         - route_map: MAP01
#           routes: static
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#       passive_interface: true
#       vrf: vrfmerge
#
# commands:
#
# - no router ospfv3
#
# after: {}

# After state:
# ------------
# veos#show running-config | section ospfv3
# router ospfv3 vrf vrfmerge
#    passive-interface default
#    !
#    address-family ipv4
#       redistribute connected
#       redistribute static route-map MAP01
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30
#    !
#    address-family ipv6
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30

# using parsed

# parsed_ospfv3.cfg
# router ospfv3
#    fips restrictions
#    area 0.0.0.20 stub
#    area 0.0.0.20 authentication ipsec spi 33 sha1 passphrase 7 4O8T3zo4xBdRWXBnsnK934o9SEb+jEhHUN6+xzZgCo2j9EnQBUvtwNxxLEmYmm6w
#    area 0.0.0.40 default-cost 45
#    area 0.0.0.40 stub
#    timers pacing flood 7
#    adjacency exchange-start threshold 11
#    !
#    address-family ipv4
#       fips restrictions
#       redistribute connected
#    !
#    address-family ipv6
#       router-id 10.1.1.1
#       fips restrictions
# !
# router ospfv3 vrf vrf01
#    bfd all-interfaces
#    fips restrictions
#    area 0.0.0.0 encryption ipsec spi 256 esp null sha1 passphrase 7 7hl8FV3lZ6H1mAKpjL47hQ==
#    log-adjacency-changes detail
#    !
#    address-family ipv4
#       passive-interface default
#       fips restrictions
#       redistribute connected route-map MAP01
#       maximum-paths 100
#    !
#    address-family ipv6
#       fips restrictions
#       area 0.0.0.10 nssa no-summary
#       default-information originate route-map DefaultRouteFilter
#       max-metric router-lsa external-lsa 25 summary-lsa
# !
# router ospfv3 vrf vrf02
#    fips restrictions
#    !
#    address-family ipv6
#       router-id 10.17.0.3
#       distance ospf intra-area 200
#       fips restrictions
#       area 0.0.0.1 stub
#       timers spf delay initial 56 56 56
#       timers out-delay 10

- name: Parse the provided config
  arista.eos.eos_ospfv3:
    running_config: "{{ lookup('file', './parsed_ospfv3.cfg') }}"
    state: parsed

# Task output:
# ------------
# parsed:
#     processes:
#     - address_family:
#       - afi: ipv4
#         fips_restrictions: true
#         redistribute:
#         - routes: connected
#       - afi: ipv6
#         fips_restrictions: true
#         router_id: 10.1.1.1
#       adjacency:
#         exchange_start:
#           threshold: 11
#       areas:
#       - area_id: 0.0.0.20
#         authentication:
#           algorithm: sha1
#           hidden_key: true
#           passphrase: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
#           spi: 33
#         stub:
#           set: true
#       - area_id: 0.0.0.40
#         default_cost: 45
#         stub:
#           set: true
#       fips_restrictions: true
#       timers:
#         pacing: 7
#       vrf: default
#     - address_family:
#       - afi: ipv4
#         fips_restrictions: true
#         maximum_paths: 100
#         passive_interface: true
#         redistribute:
#         - route_map: MAP01
#           routes: connected
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.10
#           nssa:
#             no_summary: true
#         default_information:
#           originate: true
#           route_map: DefaultRouteFilter
#         fips_restrictions: true
#         max_metric:
#           router_lsa:
#             external_lsa:
#               max_metric_value: 25
#             summary_lsa:
#               set: true
#       areas:
#       - area_id: 0.0.0.0
#         encryption:
#           algorithm: sha1
#           encryption: 'null'
#           hidden_key: true
#           passphrase: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
#           spi: 256
#       bfd:
#         all_interfaces: true
#       fips_restrictions: true
#       log_adjacency_changes:
#         detail: true
#       vrf: vrf01
#     - address_family:
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.1
#           stub:
#             set: true
#         distance: 200
#         fips_restrictions: true
#         router_id: 10.17.0.3
#         timers:
#           out_delay: 10
#           spf:
#             initial: 56
#             max: 56
#             min: 56
#       fips_restrictions: true
#       vrf: vrf02

# using gathered

# native config:
# veos#show running-config | section ospfv3
# router ospfv3 vrf vrfmerge
#    passive-interface default
#    !
#    address-family ipv4
#       redistribute connected
#       redistribute static route-map MAP01
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30
#    !
#    address-family ipv6
#       area 0.0.0.3 range 10.1.2.0/24
#       area 0.0.0.3 range 60.1.0.0/16 cost 30

- name: Gather running configuration
  arista.eos.eos_ospfv3:
    state: gathered

# Task output:
# ------------
# gathered:
#     processes:
#     - address_family:
#       - afi: ipv4
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#         redistribute:
#         - routes: connected
#         - route_map: MAP01
#           routes: static
#       - afi: ipv6
#         areas:
#         - area_id: 0.0.0.3
#           ranges:
#           - address: 10.1.2.0/24
#           - address: 60.1.0.0/16
#             cost: 30
#       passive_interface: true
#       vrf: vrfmerge


# using rendered

- name: render CLI commands for provided config
  arista.eos.eos_ospfv3:
    config:
      processes:
        - address_family:
            - timers:
                lsa: 22
              graceful_restart:
                grace_period: 35
              afi: "ipv6"
          timers:
            pacing: 55
          fips_restrictions: true
          router_id: "2.2.2.2"
          vrf: "vrfmerge"
    state: rendered

# Task output:
# ------------
# rendered:
# - router ospfv3 vrf vrfmerge
# - address-family ipv6
# - graceful-restart grace-period 35
# - timers lsa arrival 22
# - exit
# - timers pacing flood 55
# - fips restrictions
# - router-id 2.2.2.2
# - exit

返回值

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

描述

after

字典

模块执行后的最终配置。

返回: 当发生更改时

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

before

字典

模块执行之前的配置。

返回:statemergedreplacedoverriddendeletedpurged

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

commands

列表 / 元素=字符串

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

返回:statemergedreplacedoverriddendeletedpurged

示例: ["router ospfv3 vrf vrfmerge", "address-family ipv6", "graceful-restart grace-period 35"]

gathered

字典

从远程设备收集的网络资源的事实,以结构化数据的形式呈现。

返回:stategathered

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

parsed

字典

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

返回:stateparsed

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

rendered

列表 / 元素=字符串

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

返回:staterendered

示例: ["router ospfv3 vrf vrfmerge", "address-family ipv6", "graceful-restart grace-period 35"]

作者

  • Gomathi Selvi Srinivasan (@GomathiselviS)