dellemc.enterprise_sonic.sonic_pim_interfaces 模块 – 在 SONiC 上管理接口特定的 PIM 配置

注意

此模块是 dellemc.enterprise_sonic 集合 (版本 2.5.1) 的一部分。

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

要安装它,请使用: ansible-galaxy collection install dellemc.enterprise_sonic

要在剧本中使用它,请指定: dellemc.enterprise_sonic.sonic_pim_interfaces

dellemc.enterprise_sonic 2.5.0 中的新增功能

概要

  • 此模块提供运行 SONiC 的设备的接口特定 PIM 参数的配置管理。

  • 需要在设备中提前创建 BFD 配置文件。

参数

参数

注释

config

列表 / 元素=字典

指定接口特定的 PIM 配置。

bfd_enable

布尔值

启用 PIM 的 BFD 支持。

选项

  • false

  • true

bfd_profile

字符串

指定要启用的 BFD 配置文件。

必须启用 PIM 的 BFD 支持才能配置 BFD 配置文件。

drpriority

整数

指定指定路由器优先级。

范围是 1 到 4294967295。

hello_interval

整数

指定 Hello 间隔(秒)。

范围是 1 到 255。

name

字符串 / 必需

接口的全名。

sparse_mode

布尔值

启用 PIM 稀疏模式。

选项

  • false

  • true

state

字符串

模块完成后的配置状态。

merged - 将提供的接口特定 PIM 配置与设备上的配置合并。

replaced - 将指定接口的设备上 PIM 配置替换为提供的配置。

overridden - 使用提供的配置覆盖所有设备上的接口特定 PIM 配置。

deleted - 删除设备上的接口特定 PIM 配置。

选项

  • "merged" ← (默认)

  • "deleted"

  • "replaced"

  • "overridden"

备注

注意

  • 支持 check_mode

示例

# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim drpriority 10
#  ip pim hello 60
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
# sonic#

  - name: Delete specified interface PIM configurations
    dellemc.enterprise_sonic.sonic_pim_interfaces:
      config:
        - name: 'Eth1/1'
          hello_interval: 60
          bfd_profile: profile_1
        - name: 'Eth1/2'
      state: deleted

# After State:
# ------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim drpriority 10
#  ip pim bfd
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
# sonic#


# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim drpriority 10
#  ip pim hello 60
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
# sonic#

  - name: Delete all interface-specific PIM configurations
    dellemc.enterprise_sonic.sonic_pim_interfaces:
      config:
      state: deleted

# After State:
# ------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
# sonic#


# Using merged
#
# Before State:
# -------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim hello 45
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
# sonic#

  - name: Merge provided interface PIM configurations
    dellemc.enterprise_sonic.sonic_pim_interfaces:
      config:
        - name: 'Eth1/1'
          drpriority: 10
          hello_interval: 60
          bfd_enable: true
          bfd_profile: profile_1
        - name: 'Eth1/2'
          hello_interval: 60
          bfd_enable: true
      state: merged

# After State:
# ------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim drpriority 10
#  ip pim hello 60
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
# sonic#


# Using replaced
#
# Before State:
# -------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim drpriority 10
#  ip pim hello 45
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
# sonic#

  - name: Replace PIM configurations for specified interfaces
    dellemc.enterprise_sonic.sonic_pim_interfaces:
      config:
        - name: 'Eth1/1'
          hello_interval: 60
          bfd_enable: true
          bfd_profile: profile_1
      state: replaced

# After State:
# ------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
# sonic#


# Using overridden
#
# Before State:
# -------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim sparse-mode
#  ip pim drpriority 10
#  ip pim hello 45
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
# sonic#

  - name: Override interface-specific PIM configurations
    dellemc.enterprise_sonic.sonic_pim_interfaces:
      config:
        - name: 'Eth1/1'
          hello_interval: 60
          bfd_enable: true
          bfd_profile: profile_1
      state: overridden

# After State:
# ------------
#
# sonic# show running-configuration interface Eth 1/1 | grep "ip pim"
#  ip pim hello 60
#  ip pim bfd
#  ip pim bfd profile profile_1
# sonic# show running-configuration interface Eth 1/2 | grep "ip pim"
# sonic#

返回值

公共返回值已在此处记录,以下是此模块特有的字段

描述

after

列表 / 元素=字符串

模块调用后的结果配置。

返回:发生更改时

示例: ["The configuration returned will always be in the same format\n as the parameters above.\n"]

after(generated)

列表 / 元素=字符串

模块调用时生成的配置。

返回:check_mode

示例: ["The configuration returned will always be in the same format\n as the parameters above.\n"]

before

列表 / 元素=字符串

模块调用前的配置。

返回:始终

示例: ["The configuration returned will always be in the same format\n as the parameters above.\n"]

commands

列表 / 元素=字符串

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

返回:始终

示例: ["command 1", "command 2", "command 3"]

作者

  • Arun Saravanan Balachandran (@ArunSaravananBalachandran)