dellemc.enterprise_sonic.sonic_drop_counter module – Manage drop counter configuration on SONiC
Note
This module is part of the dellemc.enterprise_sonic collection (version 3.2.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_drop_counter.
New in dellemc.enterprise_sonic 3.1.0
Synopsis
This module provides configuration management of drop counter for devices running SONiC
Parameters
Parameter |
Comments |
|---|---|
List of drop counter configurations |
|
Alias of drop counter |
|
Description of drop counter |
|
Type of drop counter Choices:
|
|
Enable drop counter Choices:
|
|
Group of drop counter |
|
Mirror session to mirror the drop counter |
|
Name of drop counter |
|
List of drop counter reasons Choices:
|
|
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" state
#
# Before state:
# -------------
#
# sonic# show running-configuration dropcounters
# (No 'dropcounters' configuration present)
- name: Merge drop counter configuration
dellemc.enterprise_sonic.sonic_drop_counter:
config:
- name: counter1
alias: c1
counter_description: abc
counter_type: PORT_INGRESS_DROPS
enable: true
group: group1
mirror: session1
reasons:
- ANY
state: merged
# After state:
# ------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# enable
# type PORT_INGRESS_DROPS
# alias c1
# group group1
# description "abc"
# mirror session1
# add-reason ANY
# Using "replaced" state
#
# Before state:
# -------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# enable
# type PORT_INGRESS_DROPS
# alias c1
# group group1
# description "abc"
# mirror session1
# add-reason ANY
# !
# dropcounters counter2
# no enable
# type PORT_INGRESS_DROPS
# alias drop2
# group group2
# description "xyz789"
# add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
- name: Replace drop counter configuration
dellemc.enterprise_sonic.sonic_drop_counter:
config:
- name: counter1
counter_description: abc123
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# description "abc123"
# !
# dropcounters counter2
# no enable
# type PORT_INGRESS_DROPS
# alias drop2
# group group2
# description "xyz789"
# add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
# Using "overridden" state
#
# Before state:
# -------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# enable
# type PORT_INGRESS_DROPS
# alias c1
# group group1
# description "abc"
# mirror session1
# add-reason ANY
# !
# dropcounters counter2
# no enable
# type PORT_INGRESS_DROPS
# alias drop2
# group group2
# description "xyz789"
# add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
- name: Override drop counter configuration
dellemc.enterprise_sonic.sonic_drop_counter:
config:
- name: counter3
alias: c3
counter_description: qwerty
counter_type: PORT_INGRESS_DROPS
enable: true
group: group3
mirror: session2
reasons:
- ACL_ANY
- FDB_AND_BLACKHOLE_DISCARDS
state: overridden
# After state:
# ------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter3
# enable
# type PORT_INGRESS_DROPS
# alias c3
# group group3
# description "qwerty"
# mirror session2
# add-reason ACL_ANY,FDB_AND_BLACKHOLE_DISCARDS
# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# enable
# type PORT_INGRESS_DROPS
# alias c1
# group group1
# description "abc"
# mirror session1
# add-reason ANY
# !
# dropcounters counter2
# no enable
# type PORT_INGRESS_DROPS
# alias drop2
# group group2
# description "xyz789"
# add-reason IP_HEADER_ERROR,L3_EGRESS_LINK_DOWN,SMAC_EQUALS_DMAC
- name: Delete drop counter configuration
dellemc.enterprise_sonic.sonic_drop_counter:
config:
- name: counter1
alias: c1
counter_description: abc
- name: counter2
state: deleted
# After state:
# ------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# enable
# type PORT_INGRESS_DROPS
# group group1
# mirror session1
# add-reason ANY
# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration dropcounters
# !
# dropcounters counter1
# enable
# type PORT_INGRESS_DROPS
# group group1
# mirror session1
# add-reason ANY
- name: Delete all drop counter configuration
dellemc.enterprise_sonic.sonic_drop_counter:
config:
state: deleted
# After state:
# ------------
#
# (No 'dropcounters' configuration present)
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The configuration resulting from module invocation. Returned: when changed |
|
The generated configuration from module invocation. Returned: when |
|
The configuration prior to the module invocation. Returned: always |
|
The set of commands pushed to the remote device. Returned: always Sample: |