dellemc.enterprise_sonic.sonic_pim_global 模块 – 在 SONiC 上管理全局 PIM 配置

注意

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

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

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

要在 playbook 中使用它,请指定: dellemc.enterprise_sonic.sonic_pim_global

dellemc.enterprise_sonic 2.5.0 中的新增功能

概要

  • 此模块提供运行 SONiC 的设备的全局 PIM 参数的配置管理。

  • 需要提前在设备上创建 VRF 和前缀列表。

参数

参数

注释

config

列表 / 元素=字典

指定全局 PIM 配置。

ecmp_enable

布尔值

启用 PIM ECMP。

选项

  • false

  • true

ecmp_rebalance_enable

布尔值

启用 PIM ECMP 重新平衡。

必须启用 ECMP 才能配置 ECMP 重新平衡。

选项

  • false

  • true

join_prune_interval

整数

以秒为单位指定 PIM 加入剪除间隔。

范围为 60 到 600。

keepalive_timer

整数

以秒为单位指定 PIM 保活定时器。

范围为 31 到 60000。

ssm_prefix_list

字符串

指定 SSM 前缀列表。

vrf_name

字符串

PIM 配置所属的 VRF 的名称。

默认值: "default"

state

字符串

模块完成后的配置状态。

merged - 将提供的全局 PIM 配置与设备上的配置合并。

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

overridden - 将所有设备上的全局 PIM 配置替换为提供的配置。

deleted - 删除设备上的全局 PIM 配置。

选项

  • "merged" ← (默认)

  • "deleted"

  • "replaced"

  • "overridden"

备注

注意

  • 支持 check_mode

示例

# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 60
# ip pim vrf VrfReg1 keep-alive-timer 180
# ip pim vrf VrfReg1 ssm prefix-list prefix-list-1
# ip pim vrf VrfReg2 ecmp
# ip pim vrf VrfReg2 ssm prefix-list prefix-list-2
# ip pim vrf default ecmp
# ip pim vrf default ecmp rebalance
# sonic#

  - name: Delete specified global PIM configurations
    dellemc.enterprise_sonic.sonic_pim_global:
      config:
        - vrf_name: 'VrfReg1'
          join_prune_interval: 60
          keepalive_timer: 180
        - vrf_name: 'VrfReg2'
      state: deleted

# After State:
# ------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 ssm prefix-list prefix-list-1
# ip pim vrf default ecmp
# ip pim vrf default ecmp rebalance
# sonic#


# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 60
# ip pim vrf VrfReg1 keep-alive-timer 180
# ip pim vrf VrfReg1 ssm prefix-list prefix-list-1
# ip pim vrf VrfReg2 ecmp
# ip pim vrf VrfReg2 ssm prefix-list prefix-list-2
# ip pim vrf default ecmp
# ip pim vrf default ecmp rebalance
# sonic#

  - name: Delete all global PIM configurations
    dellemc.enterprise_sonic.sonic_pim_global:
      config:
      state: deleted

# After State:
# ------------
#
# sonic# show running-configuration | grep "ip pim"
# sonic#


# Using merged
#
# Before State:
# -------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf default join-prune-interval 120
# ip pim vrf default keep-alive-timer 360
# ip pim vrf default ssm prefix-list prefix-list-1
# sonic#

  - name: Merge provided global PIM configurations
    dellemc.enterprise_sonic.sonic_pim_global:
      config:
        - vrf_name: 'default'
          ecmp_enable: true
          ecmp_rebalance_enable: true
          join_prune_interval: 60
          keepalive_timer: 180
          ssm_prefix_list: 'prefix-list-def'
        - vrf_name: 'VrfReg1'
          join_prune_interval: 60
          keepalive_timer: 180
        - vrf_name: 'VrfReg2'
          ssm_prefix_list: 'prefix-list-2'
      state: merged

# After State:
# ------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 60
# ip pim vrf VrfReg1 keep-alive-timer 180
# ip pim vrf VrfReg2 ssm prefix-list prefix-list-2
# ip pim vrf default ecmp
# ip pim vrf default ecmp rebalance
# ip pim vrf default join-prune-interval 60
# ip pim vrf default keep-alive-timer 180
# ip pim vrf default ssm prefix-list prefix-list-def
# sonic#


# Using replaced
#
# Before State:
# -------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 60
# ip pim vrf VrfReg1 keep-alive-timer 180
# ip pim vrf VrfReg1 ssm prefix-list prefix-list-1
# ip pim vrf VrfReg2 ecmp
# ip pim vrf VrfReg2 ssm prefix-list prefix-list-2
# ip pim vrf default ecmp
# ip pim vrf default ecmp rebalance
# sonic#

  - name: Replace global PIM configurations of specified VRFs
    dellemc.enterprise_sonic.sonic_pim_global:
      config:
        - vrf_name: 'default'
          ecmp_enable: true
        - vrf_name: 'VrfReg1'
          join_prune_interval: 120
          keepalive_timer: 360
      state: replaced

# After State:
# ------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 120
# ip pim vrf VrfReg1 keep-alive-timer 360
# ip pim vrf VrfReg2 ecmp
# ip pim vrf VrfReg2 ssm prefix-list prefix-list-2
# ip pim vrf default ecmp
# sonic#


# Using replaced
#
# Before State:
# -------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 60
# ip pim vrf VrfReg1 keep-alive-timer 180
# ip pim vrf VrfReg1 ssm prefix-list prefix-list-1
# ip pim vrf VrfReg2 ecmp
# ip pim vrf VrfReg2 ssm prefix-list prefix-list-2
# ip pim vrf default ecmp
# ip pim vrf default ecmp rebalance
# sonic#

  - name: Override global PIM configurations
    dellemc.enterprise_sonic.sonic_pim_global:
      config:
        - vrf_name: 'default'
          ecmp_enable: true
        - vrf_name: 'VrfReg1'
          join_prune_interval: 120
          keepalive_timer: 360
      state: overridden

# After State:
# ------------
#
# sonic# show running-configuration | grep "ip pim"
# ip pim vrf VrfReg1 join-prune-interval 120
# ip pim vrf VrfReg1 keep-alive-timer 360
# ip pim vrf default ecmp
# 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)