dellemc.enterprise_sonic.sonic_port_breakout 模块 – 配置物理接口上的端口分路设置

注意

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

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

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

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

dellemc.enterprise_sonic 1.0.0 中的新增功能

概要

  • 此模块提供运行 Enterprise SONiC 的设备上端口分路参数的配置管理。

注意

此模块具有相应的 动作插件

参数

参数

注释

config

列表 / 元素=字典

指定与端口分路相关的配置。

mode

字符串

指定端口分路的模式。

选项

  • "1x10G"

  • "1x25G"

  • "1x40G"

  • "1x50G"

  • "1x100G"

  • "1x200G"

  • "1x400G"

  • "2x10G"

  • "2x25G"

  • "2x40G"

  • "2x50G"

  • "2x100G"

  • "2x200G"

  • "4x10G"

  • "4x25G"

  • "4x50G"

  • "4x100G"

  • "8x10G"

  • "8x25G"

  • "8x50G"

name

字符串 / 必需

指定端口分路的名称。

state

字符串

指定要对设备上配置的端口分路执行的操作。

如果为 merged,则输入模式配置将与设备上现有的端口分路配置合并。

如果为 deleted,则将从设备中删除现有的端口分路模式配置。

如果为 replaced,则指定接口的设备上端口分路配置将替换为提供的配置。

如果为 overridden,则所有设备上的端口分路配置将被提供的配置覆盖。

选项

  • "merged" ← (默认)

  • "deleted"

  • "replaced"

  • "overridden"

备注

注意

  • 针对戴尔科技公司提供的 Enterprise SONiC 发行版进行了测试。

  • 支持 check_mode

示例

# Using deleted
#
# Before state:
# -------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/1   4x10G          Completed     Eth1/1/1
#                                    Eth1/1/2
#                                    Eth1/1/3
#                                    Eth1/1/4
# 1/11  1x100G         Completed     Eth1/11/1
#

- name: Delete interface port breakout configuration
  dellemc.enterprise_sonic.sonic_port_breakout:
    config:
      - name: 1/11
        mode: 1x100G
    state: deleted

# After state:
# ------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/1   4x10G          Completed     Eth1/1/1
#                                    Eth1/1/2
#                                    Eth1/1/3
#                                    Eth1/1/4
# 1/11  Default        Completed     Eth1/11
#


# Using deleted
#
# Before state:
# -------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/1   4x10G          Completed     Eth1/1/1
#                                    Eth1/1/2
#                                    Eth1/1/3
#                                    Eth1/1/4
# 1/11  1x100G         Completed     Eth1/11/1
#

- name: Delete all port breakout configurations
  dellemc.enterprise_sonic.sonic_port_breakout:
    config:
    state: deleted

# After state:
# ------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/1   Default        Completed     Eth1/1
# 1/11  Default        Completed     Eth1/11


# Using merged
#
# Before state:
# -------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/1   4x10G          Completed     Eth1/1/1
#                                    Eth1/1/2
#                                    Eth1/1/3
#                                    Eth1/1/4
#

- name: Merge port breakout configurations
  dellemc.enterprise_sonic.sonic_port_breakout:
    config:
      - name: 1/11
        mode: 1x100G
    state: merged

# After state:
# ------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/1   4x10G          Completed     Eth1/1/1
#                                    Eth1/1/2
#                                    Eth1/1/3
#                                    Eth1/1/4
# 1/11  1x100G         Completed     Eth1/11/1


# Using replaced
#
# Before state:
# -------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/49   4x25G         Completed     Eth1/49/1
#                                    Eth1/49/2
#                                    Eth1/49/3
#                                    Eth1/49/4
#

- name: Replace port breakout configurations
  dellemc.enterprise_sonic.sonic_port_breakout:
    config:
      - name: 1/49
        mode: 4x10G
    state: replaced

# After state:
# ------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/49   4x10G         Completed     Eth1/49/1
#                                    Eth1/49/2
#                                    Eth1/49/3
#                                    Eth1/49/4


# Using overridden
#
# Before state:
# -------------
#
# sonic# show interface breakout
# ----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/49  4x10G          Completed     Eth1/49/1
#                                    Eth1/49/2
#                                    Eth1/49/3
#                                    Eth1/49/4
# 1/50  2x50G          Completed     Eth1/50/1
#                                    Eth1/50/2
# 1/51  1x100G         Completed     Eth1/51/1
#

- name: Override port breakout configurations
  dellemc.enterprise_sonic.sonic_port_breakout:
    config:
      - name: 1/52
        mode: 4x10G
    state: overridden

# After state:
# ------------
#
# sonic# show interface breakout
# -----------------------------------------------
# Port  Breakout Mode  Status        Interfaces
# -----------------------------------------------
# 1/49  Default        Completed     Eth1/49
# 1/50  Default        Completed     Eth1/50
# 1/51  Default        Completed     Eth1/51
# 1/52  4x10G          Completed     Eth1/52/1
#                                    Eth1/52/2
#                                    Eth1/52/3
#                                    Eth1/52/4

返回值

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

描述

after

列表 / 元素=字符串

模块调用后的结果配置。

返回:发生更改时

示例: ["返回的配置将始终与上面的参数格式相同。\n"]

before

列表 / 元素=字符串

模块调用之前的配置。

返回:始终

示例: ["返回的配置将始终与上面的参数格式相同。\n"]

commands

列表 / 元素=字符串

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

返回:始终

示例: ["命令 1", "命令 2", "命令 3"]

作者

  • Niraimadaiselvam M (@niraimadaiselvamm)