dellemc.enterprise_sonic.sonic_mclag 模块 – 管理多机箱链路聚合组域 (MCLAG) 及其参数
注意
此模块是 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_mclag
。
dellemc.enterprise_sonic 1.0.0 中的新增功能
概要
管理多机箱链路聚合组域 (MCLAG) 及其参数。
注意
此模块具有相应的 动作插件。
参数
参数 |
注释 |
---|---|
MCLAG 域配置的字典。 |
|
MCLAG 延迟恢复时间(以秒为单位)。 |
|
MCLAG 域的 ID(MCLAG 域)。 |
|
MCLAG 上路由器端口的网关 MAC 地址。 仅当 state=replaced 或 state=overridden 时才能修改配置的网关 MAC 地址。 |
|
MCLAG 会话 keepalive-interval(以秒为单位)。 |
|
保存 MCLAG 域的端口通道字典。 |
|
保存用于配置为 MCLAG 接口的端口通道列表。 |
|
保存端口通道 ID。 |
|
相应 MCLAG 的 IPV4 对等 IP。 |
|
保存 MCLAG 对等网关的 VLAN 字典。 |
|
保存启用 MCLAG 对等网关功能的 VLAN 和 VLAN 范围的列表。 |
|
保存 VLAN 名称或 VLAN 范围。 指定单个 VLAN,例如 Vlan10。 指定 VLAN 范围,例如 Vlan10-20。 |
|
相应 MCLAG 的对等链路。 |
|
MCLAG 会话超时值(以秒为单位)。 |
|
MCLAG 会话 VRF。 会话 VRF 值可以是 mgmt 或非默认 VRF。 |
|
相应 MCLAG 的 IPV4 源 IP。 |
|
MCLAG 的 MAC 地址。 |
|
保存 MCLAG 唯一 IP 的 VLAN 字典。 |
|
保存 VLAN 和 VLAN 范围的列表,对于这些 VLAN 和 VLAN 范围,为 MCLAG 启用了单独的 IP 地址以支持第 3 层协议。 |
|
保存 VLAN 名称或 VLAN 范围。 指定单个 VLAN,例如 Vlan10。 指定 VLAN 范围,例如 Vlan10-20。 |
|
应将配置保留在的状态。 选项
|
注释
注意
针对 Dell Technologies 的 Enterprise SONiC 发行版进行了测试。
支持
check_mode
。
示例
# Using merged
#
# Before state:
# -------------
#
# sonic# show mclag brief
# MCLAG Not Configured
- name: Merge provided configuration with device configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
domain_id: 1
peer_address: 1.1.1.1
source_address: 2.2.2.2
peer_link: 'Portchannel1'
session_vrf: 'mgmt'
keepalive: 1
session_timeout: 3
delay_restore: 240
system_mac: '00:00:00:11:11:11'
gateway_mac: '00:00:00:12:12:12'
unique_ip:
vlans:
- vlan: Vlan4
- vlan: Vlan21-25
peer_gateway:
vlans:
- vlan: Vlan4
- vlan: Vlan21-25
members:
portchannels:
- lag: PortChannel10
state: merged
# After state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 2.2.2.2
# Peer Address : 1.1.1.1
# Session Vrf : mgmt
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 3 secs
# Delay Restore : 240 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:1
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
# Using merged
#
# Before state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 2.2.2.2
# Peer Address : 1.1.1.1
# Session Vrf : mgmt
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 3 secs
# Delay Restore : 240 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:1
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
- name: Merge device configuration with the provided configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
domain_id: 1
source_address: 3.3.3.3
keepalive: 10
session_timeout: 30
session_vrf: VrfRed
delay_restore: 360
unique_ip:
vlans:
- vlan: Vlan5
- vlan: Vlan26-28
peer_gateway:
vlans:
- vlan: Vlan5
- vlan: Vlan26-28
members:
portchannels:
- lag: PortChannel12
state: merged
# After state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 3.3.3.3
# Peer Address : 1.1.1.1
# Session Vrf : VrfRed
# Peer Link : PortChannel1
# Keepalive Interval : 10 secs
# Session Timeout : 30 secs
# Delay Restore : 360 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:2
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
# PortChannel12 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan5
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# Vlan26
# Vlan27
# Vlan28
# ==============
# Total count : 10
# ==============
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan5
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# Vlan26
# Vlan27
# Vlan28
# ==============
# Total count : 10
# ==============
# sonic#
# Using deleted
#
# Before state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 3.3.3.3
# Peer Address : 1.1.1.1
# Session Vrf : VrfRed
# Peer Link : PortChannel1
# Keepalive Interval : 10 secs
# Session Timeout : 30 secs
# Delay Restore : 360 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:1
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
- name: Delete device configuration based on the provided configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
domain_id: 1
source_address: 3.3.3.3
keepalive: 10
session_vrf: VrfRed
unique_ip:
vlans:
- vlan: Vlan22
- vlan: Vlan24-25
peer_gateway:
vlans:
- vlan: Vlan22
- vlan: Vlan24-25
members:
portchannels:
- lag: PortChannel10
state: deleted
# After state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address :
# Peer Address : 1.1.1.1
# Session Vrf : default
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 30 secs
# Delay Restore : 360 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:0
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan23
# ==============
# Total count : 3
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan23
# ==============
# Total count : 3
# ==============
# sonic#
# Using deleted
#
# Before state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 3.3.3.3
# Peer Address : 1.1.1.1
# Session Vrf : default
# Peer Link : PortChannel1
# Keepalive Interval : 10 secs
# Session Timeout : 30 secs
# Delay Restore : 360 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:1
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# ==============
# Total count : 1
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# ==============
# Total count : 1
# ==============
# sonic#
- name: Delete all device configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
state: deleted
# After state:
# ------------
#
# sonic# show mclag brief
# MCLAG Not Configured
# sonic# show mclag separate-ip-interfaces
# MCLAG separate IP interface not configured
# sonic# show mclag peer-gateway-interfaces
# MCLAG Peer Gateway interface not configured
# sonic#
# Using deleted
#
# Before state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 3.3.3.3
# Peer Address : 1.1.1.1
# Session Vrf : default
# Peer Link : PortChannel1
# Keepalive Interval : 10 secs
# Session Timeout : 30 secs
# Delay Restore : 360 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:2
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
# PortChannel12 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# ==============
# Total count : 1
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# ==============
# Total count : 1
# ==============
# sonic#
- name: Delete device configuration based on the provided configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
domain_id: 1
source_address: 3.3.3.3
keepalive: 10
peer_gateway:
vlans:
members:
portchannels:
state: deleted
# After state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address :
# Peer Address : 1.1.1.1
# Session Vrf : default
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 30 secs
# Delay Restore : 360 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:0
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# ==============
# Total count : 1
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# MCLAG Peer Gateway interface not configured
# sonic#
# Using replaced
#
# Before state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 2.2.2.2
# Peer Address : 1.1.1.1
# Session Vrf : VrfRed
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 3 secs
# Delay Restore : 240 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:2
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
# PortChannel11 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
- name: Replace device configuration with the provided configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
domain_id: 1
unique_ip:
vlans:
- vlan: Vlan5
- vlan: Vlan24-28
session_vrf: VrfBlue
peer_gateway:
vlans:
- vlan: Vlan5
- vlan: Vlan24-28
members:
portchannels:
- lag: PortChannel10
- lag: PortChannel12
state: replaced
# After state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 2.2.2.2
# Peer Address : 1.1.1.1
# Session Vrf : VrfBlue
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 3 secs
# Delay Restore : 240 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:2
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
# PortChannel12 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan5
# Vlan24
# Vlan25
# Vlan26
# Vlan27
# Vlan28
# ==============
# Total count : 6
# ==============
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan5
# Vlan24
# Vlan25
# Vlan26
# Vlan27
# Vlan28
# ==============
# Total count : 6
# ==============
# sonic#
# Using overridden
#
# Before state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 2.2.2.2
# Peer Address : 1.1.1.1
# Session Vrf : VrfBlue
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 3 secs
# Delay Restore : 240 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:2
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
# PortChannel11 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan4
# Vlan21
# Vlan22
# Vlan23
# Vlan24
# Vlan25
# ==============
# Total count : 6
# ==============
# sonic#
- name: Override device configuration with the provided configuration
dellemc.enterprise_sonic.sonic_mclag:
config:
domain_id: 1
peer_address: 1.1.1.1
source_address: 3.3.3.3
peer_link: 'Portchannel1'
session_vrf: VrfRed
system_mac: '00:00:00:11:11:11'
gateway_mac: '00:00:00:12:12:12'
unique_ip:
vlans:
- vlan: Vlan24-28
peer_gateway:
vlans:
- vlan: Vlan24-28
members:
portchannels:
- lag: PortChannel10
- lag: PortChannel12
state: overridden
# After state:
# ------------
#
# sonic# show mclag brief
#
# Domain ID : 1
# Role : standby
# Session Status : down
# Peer Link Status : down
# Source Address : 3.3.3.3
# Peer Address : 1.1.1.1
# Session Vrf : VrfRed
# Peer Link : PortChannel1
# Keepalive Interval : 1 secs
# Session Timeout : 30 secs
# Delay Restore : 300 secs
# System Mac : 20:04:0f:37:bd:c9
# Mclag System Mac : 00:00:00:11:11:11
# Gateway Mac : 00:00:00:12:12:12
#
#
# Number of MLAG Interfaces:2
#-----------------------------------------------------------
# MLAG Interface Local/Remote Status
#-----------------------------------------------------------
# PortChannel10 down/down
# PortChannel12 down/down
#
# sonic# show mclag separate-ip-interfaces
# Interface Name
# ==============
# Vlan24
# Vlan25
# Vlan26
# Vlan27
# Vlan28
# ==============
# Total count : 5
# ==============
# sonic# show mclag peer-gateway-interfaces
# Interface Name
# ==============
# Vlan24
# Vlan25
# Vlan26
# Vlan27
# Vlan28
# ==============
# Total count : 5
# ==============
# sonic#
返回值
常见的返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
生成的配置模块调用。 返回:更改时 示例: |
|
模块调用之前的配置。 返回:始终 示例: |
|
推送到远程设备的命令集。 返回:始终 示例: |