• 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_lag_interfaces module – Manage link aggregation group (LAG) interface parameters


dellemc.enterprise_sonic.sonic_lag_interfaces module – Manage link aggregation group (LAG) interface parameters

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_lag_interfaces.

New in dellemc.enterprise_sonic 1.0.0

  • Synopsis

  • Parameters

  • Notes

  • Examples

  • Return Values

Synopsis

  • This module manages attributes of link aggregation group (LAG) interfaces of devices running Enterprise SONiC Distribution by Dell Technologies.

Parameters

Parameter

Comments

config

list / elements=dictionary

A list of LAG configurations.

ethernet_segment

dictionary

added in dellemc.enterprise_sonic 2.5.0

Specifies Ethernet segment.

esi_type and esi can not be deleted separately.

When state=deleted and both esi and df_preference are not specifed, the entire Ethernet segment will be deleted.

df_preference

integer

The preference for Designated Forwarder election method.

The range of df_preference value is from 1 to 65535.

esi

string

Specifies value of Ethernet Segment Identifier.

Only AUTO is supported when esi_type=auto_lacp or esi_type=auto_system_mac.

esi_type

string / required

Specifies type of Ethernet Segment Identifier.

Choices:

  • "auto_lacp"

  • "auto_system_mac"

  • "ethernet_segment_id"

fallback

boolean

added in dellemc.enterprise_sonic 3.1.0

Enable fallback mode.

Choices:

  • false

  • true

fast_rate

boolean

added in dellemc.enterprise_sonic 3.1.0

Enable LACP fast rate mode.

Choices:

  • false

  • true

graceful_shutdown

boolean

added in dellemc.enterprise_sonic 3.1.0

Enable graceful shutdown.

Choices:

  • false

  • true

lacp_individual

dictionary

added in dellemc.enterprise_sonic 3.1.0

Specifies LACP individual configuration.

Applicable only when mode=lacp.

enable

boolean

Enable LACP individual.

Choices:

  • false

  • true

timeout

integer

Specifies LACP individual timeout in seconds.

The range is from 3 to 90.

members

dictionary

The list of interfaces that are part of the group.

interfaces

list / elements=dictionary

The list of interfaces that are part of the group.

member

string

The interface name.

min_links

integer

added in dellemc.enterprise_sonic 3.1.0

Specifies minimum number of links.

The range is from 1 to 32.

mode

string

Specifies mode of the port-channel while creation.

Functional default is lacp.

Choices:

  • "static"

  • "lacp"

name

string / required

ID of the LAG.

system_mac

string

added in dellemc.enterprise_sonic 3.1.0

Specifies system MAC address for the portchannel.

state

string

The state that the configuration should be left in.

Choices:

  • "merged" ← (default)

  • "replaced"

  • "overridden"

  • "deleted"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

# Using "merged" state
#
# Before state:
# -------------
#
# interface Eth1/10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#

- name: Merge LAG interfaces configuration
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
      - name: PortChannel10
        fallback: true
        fast_rate: true
        graceful_shutdown: true
        members:
          interfaces:
            - member: Eth1/10
        system_mac: "12:12:12:12:12:12"
        ethernet_segment:
          esi_type: auto_lacp
          df_preference: 2222
      - name: PortChannel12
        min_links: 2
        members:
          interfaces:
            - member: Eth1/15
            - member: Eth1/16
            - member: Eth1/17
        lacp_individual:
          enable: true
          timeout: 30
    state: merged

# After state:
# ------------
#
# interface Eth1/10
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/15
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/16
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/17
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  fast_rate
#  fallback
#  graceful-shutdown
#  no shutdown
#  system-mac 12:12:12:12:12:12
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
#  !
# !
# interface PortChannel12
#  min-links 2
#  lacp individual
#  lacp individual timeout 30
#  no shutdown
#

# Using "replaced" state
#
# Before state:
# -------------
#
# interface Eth1/5
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/7
#  no channel-group
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  graceful-shutdown
#  no shutdown
#  system-mac 12:12:12:12:12:12
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
#

- name: Replace LAG configurations of specified LAG interfaces
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
      - name: PortChannel20
        members:
          interfaces:
            - member: Eth1/6
        system_mac: "14:14:14:14:14:14"
        ethernet_segment:
          esi_type: auto_system_mac
          df_preference: 6666
      - name: PortChannel10
        members:
          interfaces:
            - member: Eth1/7
        system_mac: "14:14:14:14:14:14"
        ethernet_segment:
          esi_type: auto_system_mac
          df_preference: 3333
    state: replaced

# After state:
# ------------
#
# interface Eth1/5
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/6
#  channel-group 20
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/7
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#  system-mac 14:14:14:14:14:14
#  !
#  evpn ethernet-segment auto-system-mac
#   df-preference 3333
# !
# interface PortChanne20
#  no shutdown
#  system-mac 14:14:14:14:14:14
#  !
#  evpn ethernet-segment auto-system-mac
#   df-preference 6666
#

# Using "overridden" state
#
# Before state:
# -------------
#
# interface Eth1/5
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/6
#  no channel-group
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  fast_rate
#  fallback
#  no shutdown
#  !
#  evpn ethernet-segment auto-system-mac
#   df-preference 2222
#

- name: Override all LAG interface configurations
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
      - name: PortChannel20
        min_links: 2
        members:
          interfaces:
            - member: Eth1/6
            - member: Eth1/7
            - member: Eth1/8
        system_mac: "12:12:12:12:12:12"
        ethernet_segment:
          esi_type: auto_lacp
          df_preference: 3333
        lacp_individual:
          enable: true
          timeout: 60
    state: overridden

# After state:
# ------------
#
# interface Eth1/5
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/6
#  channel-group 20
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/7
#  channel-group 20
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/8
#  channel-group 20
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel20
#  min-links 2
#  lacp individual
#  lacp individual timeout 60
#  no shutdown
#  system-mac 12:12:12:12:12:12
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 3333
#

# Using "deleted" state
#
# Before state:
# -------------
#
# interface Eth1/10
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/15
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/16
#  channel-group 12
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel 10
#  no shutdown
#  system-mac 12:12:12:12:12:12
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
# !
# interface PortChannel 12
#  fast_rate
#  fallback
#  graceful-shutdown
#  min-links 2
#  no shutdown
#

- name: Delete all LAG interfaces
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
    state: deleted

# After state:
# -------------
#
# interface Eth1/10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/15
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/16
#  mtu 9100
#  speed 100000
#  no shutdown
#

# Using "deleted" state
#
# Before state:
# -------------
# interface Eth1/10
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/11
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/20
#  channel-group 20
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  min-links 2
#  no shutdown
#  system-mac 12:12:12:12:12:12
#  !
#  evpn ethernet-segment auto-lacp
#   df-preference 2222
# !
# interface PortChannel20
#  no shutdown
#

- name: Delete specified LAG configurations and LAG interfaces
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config:
      - name: PortChannel10
        min_links: 2
        members:
          interfaces:
            - member: Eth1/10
        system_mac: "12:12:12:12:12:12"
        ethernet_segment:
          esi_type: auto_lacp
      - name: PortChannel20
    state: deleted

# After state:
# -------------
#
# interface Eth1/10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/11
#  channel-group 10
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface Eth1/20
#  mtu 9100
#  speed 100000
#  no shutdown
# !
# interface PortChannel10
#  no shutdown
#

Return Values

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

Key

Description

after

list / elements=string

The resulting configuration on module invocation.

Returned: when changed

Sample: ["The configuration returned is always in the same format as the parameters above.\n"]

after(generated)

list / elements=string

The configuration expected as a result of module invocation.

Returned: when check_mode

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

before

list / elements=string

The configuration prior to the module invocation.

Returned: always

Sample: ["The configuration that is returned is always 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

  • Abirami N (@abirami-n)

Collection links

  • Issue Tracker
  • Repository (Sources)
Previous Next

© Copyright Ansible project contributors. Last updated on Nov 04, 2025.