dellemc.enterprise_sonic.sonic_port_group module – Manages port group configuration on SONiC.
Note
This module is part of the dellemc.enterprise_sonic collection (version 3.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic
.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_port_group
.
New in dellemc.enterprise_sonic 2.1.0
Synopsis
This module provides configuration management of port group for devices running SONiC.
Parameters
Parameter |
Comments |
---|---|
A list of port group configurations. |
|
The index of the port group. |
|
Speed for the port group. This configures the speed for all the memebr ports of the prot group. Supported speeds are dependent on the type of switch. Choices:
|
|
The state of the configuration after module completion. Choices:
|
Notes
Note
Supports
check_mode
.
Examples
#
# Using deleted
#
# Before state:
# -------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 10G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
- name: Configure port group speed
sonic_port_group:
config:
- id: 1
- id: 10
state: deleted
#
#
# After state:
# ------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 25G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
# Using deleted
#
# Before state:
# -------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 10G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
- name: Configure port group speed
sonic_port_group:
config:
- id:
state: deleted
#
#
# After state:
# ------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 25G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 25G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
# Using merged
#
# Before state:
# -------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 25G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 25G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
- name: Configure port group speed
sonic_port_group:
config:
- id: 1
speed: SPEED_10GB
- id: 9
speed: SPEED_10GB
state: merged
#
#
# After state:
# ------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 10G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
# Using replaced
#
# Before state:
# -------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 25G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 10G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 25G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
- name: Replace port group speed
sonic_port_group:
config:
- id: 1
speed: SPEED_10GB
- id: 9
speed: SPEED_10GB
state: replaced
#
# After state:
# ------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 10G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 10G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
# Using overridden
#
# Before state:
# -------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 25G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 10G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 10G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 10G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 10G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 10G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 10G
#
- name: Override port group speed
sonic_port_group:
config:
- id: 1
speed: SPEED_10GB
- id: 9
speed: SPEED_10GB
state: overridden
#
# After state:
# ------------
#
#sonic# show port-group
#-------------------------------------------------------------------------------------
#Port-group Interface range Valid speeds Default Speed Current Speed
#-------------------------------------------------------------------------------------
#1 Ethernet0 - Ethernet3 10G, 25G 25G 10G
#2 Ethernet4 - Ethernet7 10G, 25G 25G 25G
#3 Ethernet8 - Ethernet11 10G, 25G 25G 25G
#4 Ethernet12 - Ethernet15 10G, 25G 25G 25G
#5 Ethernet16 - Ethernet19 10G, 25G 25G 25G
#6 Ethernet20 - Ethernet23 10G, 25G 25G 25G
#7 Ethernet24 - Ethernet27 10G, 25G 25G 25G
#8 Ethernet28 - Ethernet31 10G, 25G 25G 25G
#9 Ethernet32 - Ethernet35 10G, 25G 25G 10G
#10 Ethernet36 - Ethernet39 10G, 25G 25G 25G
#
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration module invocation. Returned: when changed Sample: |
|
The generated configuration module invocation. Returned: when Sample: |
|
The configuration prior to the module invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |