Spec-Zone.ru › Ansible

dellemc.enterprise_sonic.sonic_lst module – Manage link state tracking (LST) 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_lst.

New in dellemc.enterprise_sonic 3.1.0

  • Synopsis
  • Parameters
  • Notes
  • Examples
  • Return Values

Synopsis

  • This module provides configuration management of LST for devices running SONiC

Parameters

Parameter

Comments

config

dictionary

LST configuration

interfaces

list / elements=dictionary

LST configuration for interfaces

downstream_group

string

LST group name used to track the interface as downstream

name

string / required

Name of interface

upstream_groups

list / elements=dictionary

Upstream groups configuration

group_name

string / required

LST group name used to track the interface as upstream

lst_groups

list / elements=dictionary

LST groups configuration

all_evpn_es_downstream

boolean

Indicates that the LST group tracks all EVPN ethernet segments as downstream interfaces

Choices:

  • false
  • true

all_mclags_downstream

boolean

Indicates that the LST group tracks all MCLAGs as downstream interfaces

Choices:

  • false
  • true

group_description

string

Description of LST group

group_type

string

LST group type

Choices:

  • "l3"

name

string / required

Name of LST group

threshold_down

integer

Downstream ports will shut down if the threshold falls below this value

Range 0-100

threshold_type

string

Type of threshold calculation scheme to use

Choices:

  • "percentage"

threshold_up

integer

Downstream ports will go online if the threshold is greater than or equal to this value

Range 0-100

timeout

integer

Time in seconds to wait to bring up the downstream ports after the first upstream port is online

Range 1-1800

state

string

The state of the configuration after module completion

Choices:

  • "merged" ← (default)
  • "deleted"
  • "replaced"
  • "overridden"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.
  • Supports check_mode.

Examples

# Using "merged" state
#
# Before state:
# -------------
#
# sonic# show running-configuration link state tracking
# (No link state tracking configuration present)
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
# (No link state tracking configuration present for interface Ethernet20)
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
# (No link state tracking configuration present for interface Ethernet24)

- name: Merge LST configuration
  dellemc.enterprise_sonic.sonic_lst:
    config:
      lst_groups:
        - name: lst
          all_evpn_es_downstream: true
          group_description: abc
          group_type: l3
          threshold_down: 20
          threshold_type: percentage
          threshold_up: 40
          timeout: 120
      interfaces:
        - name: Ethernet20
          downstream_group: lst
        - name: Ethernet24
          upstream_groups:
            - group_name: lst
    state: merged

# After state:
# ------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst
#   timeout 120
#   description abc
#   downstream all-evpn-es
#   threshold type percentage up 40 down 20
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst downstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
#  link state track lst upstream


# Using "replaced" state
#
# Before state:
# -------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst
#   timeout 120
#   description abc
#   downstream all-evpn-es
#   threshold type percentage up 40 down 20
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst downstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
#  link state track lst upstream

- name: Replace LST configuration
  dellemc.enterprise_sonic.sonic_lst:
    config:
      lst_groups:
        - name: lst
          all_mclags_downstream: true
          timeout: 75
      interfaces:
        - name: Ethernet20
          upstream_groups:
            - group_name: lst
        - name: Ethernet24
          downstream_group: lst
    state: replaced

# After state:
# ------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst
#   timeout 75
#   downstream all-mclag
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst upstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
#  link state track lst downstream


# Using "overridden" state
#
# Before state:
# -------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst
#   timeout 75
#   downstream all-mclag
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst upstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
#  link state track lst downstream

- name: Override LST configuration
  dellemc.enterprise_sonic.sonic_lst:
    config:
      lst_groups:
        - name: lst2
          all_evpn_es_downstream: true
          group_description: xyz
          group_type: l3
          threshold_down: 30
          threshold_type: percentage
          threshold_up: 50
          timeout: 130
      interfaces:
        - name: Ethernet20
          downstream_group: lst2
    state: overridden

# After state:
# ------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst2
#   timeout 130
#   description xyz
#   downstream all-evpn-es
#   threshold type percentage up 50 down 30
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst2 downstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
# (No link state configuration present for interface Ethernet24)


# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst2
#   timeout 130
#   description xyz
#   downstream all-evpn-es
#   threshold type percentage up 50 down 30
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst2 downstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
#  link state track lst2 upstream

- name: Delete LST configuration
  dellemc.enterprise_sonic.sonic_lst:
    config:
      lst_groups:
        - name: lst2
          all_evpn_es_downstream: true
          group_description: xyz
          threshold_down: 30
          threshold_type: percentage
          threshold_up: 50
          timeout: 130
      interfaces:
        - name: Ethernet20
          downstream_group: lst2
        - name: Ethernet24
          upstream_groups:
            - group_name: lst2
    state: deleted

# After state:
# ------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst2
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
# (No link state configuration present for interface Ethernet20)
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
# (No link state configuration present for interface Ethernet24)


# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration link state tracking
# !
# link state track lst
#   timeout 120
#   description abc
#   downstream all-evpn-es
#   threshold type percentage up 40 down 20
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
#  link state track lst downstream
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
#  link state track lst upstream

- name: Delete LST configuration
  dellemc.enterprise_sonic.sonic_lst:
    config: {}
    state: deleted

# After state:
# ------------
#
# sonic# show running-configuration link state tracking
# (No link state tracking configuration present)
# sonic# show running-configuration interface Ethernet 20
# !
# interface Ethernet20
# (No link state tracking configuration present for interface Ethernet20)
# sonic# show running-configuration interface Ethernet 24
# !
# interface Ethernet24
# (No link state tracking configuration present for interface Ethernet24)

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

dictionary

The resulting configuration from module invocation.

Returned: when changed

Sample: "The configuration returned will always be in the same format as the parameters above.\n"

after(generated)

dictionary

The generated configuration from module invocation.

Returned: when check_mode

Sample: "The configuration returned will always be in the same format as the parameters above.\n"

before

dictionary

The configuration prior to the module invocation.

Returned: always

Sample: "The configuration returned will always be in the same format as the parameters above.\n"

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

Sample: ["command 1", "command 2", "command 3"]

Authors

    1. Talabi (@stalabi1)

Collection links

  • Issue Tracker
  • Repository (Sources)

© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/dellemc/enterprise_sonic/sonic_lst_module.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API