dellemc.enterprise_sonic.sonic_copp module – Manage CoPP 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_copp
.
New in dellemc.enterprise_sonic 2.1.0
Synopsis
This module provides configuration management of CoPP for devices running SONiC
Parameters
Parameter |
Comments |
---|---|
Specifies CoPP configurations |
|
List of CoPP entries that comprise a CoPP group |
|
Committed bucket size in packets or bytes |
|
Committed information rate in bps or pps (packets per second) |
|
Name of CoPP classifier |
|
CoPP queue ID |
|
CoPP trap action |
|
CoPP trap priority |
|
The state of the configuration after module completion Choices:
|
Notes
Note
Tested against Enterprise SONiC Distribution by Dell Technologies.
Supports
check_mode
.
Examples
# Using merged
#
# Before state:
# -------------
#
# sonic# show copp actions
# (No "copp actions" configuration present)
- name: Merge CoPP groups configuration
dellemc.enterprise_sonic.sonic_copp:
config:
copp_groups:
- copp_name: 'copp-1'
trap_priority: 1
trap_action: 'DROP'
queue: 1
cir: '45'
cbs: '45'
- copp_name: 'copp-2'
trap_priority: 2
trap_action: 'FORWARD'
queue: 2
cir: '90'
cbs: '90'
state: merged
# After state:
# ------------
#
# sonic# show copp actions
# CoPP action group copp-1
# trap-action drop
# trap-priority 1
# trap-queue 1
# police cir 45 cbs 45
# CoPP action group copp-2
# trap-action forward
# trap-priority 2
# trap-queue 2
# police cir 90 cbs 90
#
#
# Using replaced
#
# Before state:
# -------------
#
# sonic# show copp actions
# CoPP action group copp-1
# trap-action drop
# trap-priority 1
# trap-queue 1
# police cir 45 cbs 45
- name: Replace CoPP groups configuration
dellemc.enterprise_sonic.sonic_copp:
config:
copp_groups:
- copp_name: 'copp-1'
trap_priority: 2
trap_action: 'FORWARD'
queue: 2
- copp_name: 'copp-3'
trap_priority: 3
trap_action: 'DROP'
queue: 3
cir: '1000'
cbs: '1000'
state: replaced
# After state:
# ------------
#
# sonic# show copp actions
# CoPP action group copp-1
# trap-action forward
# trap-priority 2
# trap-queue 2
# CoPP action group copp-3
# trap-action drop
# trap-priority 3
# trap-queue 3
# police cir 1000 cbs 1000
#
#
# Using overridden
#
# Before state:
# -------------
#
# sonic# show copp actions
# CoPP action group copp-1
# trap-action forward
# trap-priority 2
# trap-queue 2
# CoPP action group copp-3
# trap-action drop
# trap-priority 3
# trap-queue 3
# police cir 1000 cbs 1000
- name: Override CoPP groups configuration
dellemc.enterprise_sonic.sonic_copp:
config:
copp_groups:
- copp_name: 'copp-4'
trap_priority: 4
trap_action: 'FORWARD'
queue: 4
cir: 200
cbs: 200
state: overridden
# After state:
# ------------
#
# sonic# show copp actions
# CoPP action group copp-4
# trap-action forward
# trap-priority 4
# trap-queue 4
# police cir 200 cbs 200
#
#
# Using deleted
#
# Before state:
# -------------
#
# sonic# show copp actions
# CoPP action group copp-1
# trap-action drop
# trap-priority 1
# trap-queue 1
# police cir 45 cbs 45
# CoPP action group copp-2
# trap-action forward
# trap-priority 2
# trap-queue 2
# police cir 90 cbs 90
- name: Delete CoPP groups configuration
dellemc.enterprise_sonic.sonic_copp:
config:
copp_groups:
- copp_name: 'copp-1'
trap_action: 'DROP'
cir: '45'
cbs: '45'
- copp_name: 'copp-2'
state: deleted
# After state:
# ------------
#
# sonic# show copp actions
# CoPP action group copp-1
# trap-action drop
# police cir 45 cbs 45
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: |