• Blog
  • Ansible community forum
  • Documentation
Ansible Logo
Ansible Community Documentation
Ansible

Ansible getting started

  • Getting started with Ansible
  • Getting started with Execution Environments

Installation, Upgrade & Configuration

  • Installation Guide
  • Ansible Porting Guides

Using Ansible

  • Building Ansible inventories
  • Using Ansible command line tools
  • Using Ansible playbooks
  • Protecting sensitive data with Ansible vault
  • Using Ansible modules and plugins
  • Using Ansible collections
  • Using Ansible on Windows, BSD, and z/OS UNIX
  • Ansible tips and tricks

Contributing to Ansible

  • Ansible Community Guide
  • Ansible Collections Contributor Guide
  • ansible-core Contributors Guide
  • Advanced Contributor Guide
  • Ansible documentation style guide

Extending Ansible

  • Developer Guide

Common Ansible Scenarios

  • Legacy Public Cloud Guides

Network Automation

  • Network Getting Started
  • Network Advanced Topics
  • Network Developer Guide

Ansible Galaxy

  • Galaxy User Guide
  • Galaxy Developer Guide

Reference & Appendices

  • Collection Index
    • Collections in the Amazon Namespace
    • Collections in the Ansible Namespace
    • Collections in the Arista Namespace
    • Collections in the Awx Namespace
    • Collections in the Azure Namespace
    • Collections in the Check_point Namespace
    • Collections in the Chocolatey Namespace
    • Collections in the Cisco Namespace
    • Collections in the Cloud Namespace
    • Collections in the Cloudscale_ch Namespace
    • Collections in the Community Namespace
    • Collections in the Containers Namespace
    • Collections in the Cyberark Namespace
    • Collections in the Dellemc Namespace
      • Dellemc.Enterprise_Sonic
        • Description
        • Plugin Index
      • Dellemc.Openmanage
      • Dellemc.Powerflex
      • Dellemc.Unity
    • Collections in the F5networks Namespace
    • Collections in the Fortinet Namespace
    • Collections in the Frr Namespace
    • Collections in the Gluster Namespace
    • Collections in the Google Namespace
    • Collections in the Grafana Namespace
    • Collections in the Hetzner Namespace
    • Collections in the Hitachivantara Namespace
    • Collections in the Hpe Namespace
    • Collections in the Ibm Namespace
    • Collections in the Ieisystem Namespace
    • Collections in the Infinidat Namespace
    • Collections in the Infoblox Namespace
    • Collections in the Inspur Namespace
    • Collections in the Junipernetworks Namespace
    • Collections in the Kaytus Namespace
    • Collections in the Kubernetes Namespace
    • Collections in the Kubevirt Namespace
    • Collections in the Lowlydba Namespace
    • Collections in the Mellanox Namespace
    • Collections in the Microsoft Namespace
    • Collections in the Netapp Namespace
    • Collections in the Netapp_eseries Namespace
    • Collections in the Netbox Namespace
    • Collections in the Ngine_io Namespace
    • Collections in the Openstack Namespace
    • Collections in the Openvswitch Namespace
    • Collections in the Ovirt Namespace
    • Collections in the Purestorage Namespace
    • Collections in the Ravendb Namespace
    • Collections in the Sensu Namespace
    • Collections in the Servicenow Namespace
    • Collections in the Splunk Namespace
    • Collections in the T_systems_mms Namespace
    • Collections in the Telekom_mms Namespace
    • Collections in the Theforeman Namespace
    • Collections in the Vmware Namespace
    • Collections in the Vultr Namespace
    • Collections in the Vyos Namespace
    • Collections in the Wti Namespace
  • Indexes of all modules and plugins
  • Playbook Keywords
  • Return Values
  • Ansible Configuration Settings
  • Controlling how Ansible behaves: precedence rules
  • YAML Syntax
  • Python 3 Support
  • Interpreter Discovery
  • Releases and maintenance
  • Testing Strategies
  • Sanity Tests
  • Frequently Asked Questions
  • Glossary
  • Ansible Reference: Module Utilities
  • Special Variables
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • Logging Ansible output

Roadmaps

  • Ansible Roadmap
  • ansible-core Roadmaps




Ansible
  • Collection Index
  • Collections in the Dellemc Namespace
  • Dellemc.Enterprise_Sonic
  • dellemc.enterprise_sonic.sonic_lst module – Manage link state tracking (LST) configuration on SONiC


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)
Previous Next

© Copyright Ansible project contributors. Last updated on Oct 30, 2025.