• 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
    • 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 Graphiant Namespace
      • Graphiant.Naas
        • Description
        • Communication
        • Plugin Index
    • 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 Pcg 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 Graphiant Namespace
  • Graphiant.Naas
  • graphiant.naas.graphiant_lag_interfaces module – Manage Graphiant LAG (Link Aggregation Group) configuration
  • Edit on GitHub

graphiant.naas.graphiant_lag_interfaces module – Manage Graphiant LAG (Link Aggregation Group) configuration

Note

This module is part of the graphiant.naas collection (version 26.3.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 graphiant.naas. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: graphiant.naas.graphiant_lag_interfaces.

New in graphiant.naas 26.1.0

  • Synopsis

  • Requirements

  • Parameters

  • Attributes

  • Notes

  • See Also

  • Examples

  • Return Values

Synopsis

  • This module provides comprehensive LAG management for Graphiant Edge and Gateway devices.

  • Supports configuring and deconfiguring LAGs, adding/removing LAG members, updating LACP settings, and managing LAG subinterfaces (VLANs).

  • All operations use Jinja2 templates for consistent configuration deployment.

  • Configuration files support Jinja2 templating for dynamic generation.

  • All operations are idempotent - safe to run multiple times without causing errors or unintended changes.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.7

  • graphiant-sdk >= 26.3.0

Parameters

Parameter

Comments

access_token

string

Bearer token for API authentication (for example, from graphiant login, which opens a browser for sign-in (SSO or non-SSO) and retrieves the token).

If not passed as a module argument, the collection reads GRAPHIANT_ACCESS_TOKEN (set after graphiant login when you source ~/.graphiant/env.sh).

When a bearer token is present (module argument or environment), it takes precedence over username and password.

If no valid token is available, the module authenticates with username and password when both are supplied.

detailed_logs

boolean

Enable detailed logging output for troubleshooting and monitoring.

When enabled, provides comprehensive logs of all LAG operations.

Logs are captured and included in the result_msg for display using ansible.builtin.debug module.

Choices:

  • false ← (default)

  • true

host

aliases: base_url

string / required

Graphiant portal host URL for API connectivity.

Example: “https://api.graphiant.com”

lag_config_file

string / required

Path to the LAG configuration YAML file.

Required for all operations.

Can be an absolute path or relative path. Relative paths are resolved using the configured config_path.

Configuration files support Jinja2 templating syntax for dynamic generation.

File must contain LAG definitions with device names, LAG name/alias, segment, mtu, ipv4, ipv6, lacpMode, lacpTimer, member interfaces, and optional subinterfaces.

operation

string

The specific LAG operation to perform.

configure: Configure LAG for devices in the config file.

“deconfigure: Delete ALL subinterfaces (if present) and then delete the main LAG interface. Complete cleanup operation.”

add_lag_members: Add member interfaces to an existing LAG.

remove_lag_members: Remove member interfaces from an existing LAG.

update_lacp_configs: Update LACP mode/timer.

delete_lag_subinterfaces: Delete VLAN subinterfaces under the LAG.

Note: To add/configure LAG subinterfaces, use configure operation with subinterfaces in the config file.

Choices:

  • "configure"

  • "deconfigure"

  • "add_lag_members"

  • "remove_lag_members"

  • "update_lacp_configs"

  • "delete_lag_subinterfaces"

password

string

Graphiant portal password for authentication.

Required for password-based login when no valid bearer token is available from access_token or GRAPHIANT_ACCESS_TOKEN.

state

string

The desired state of the LAG configuration.

present: Maps to configure when operation is not specified.

absent: Maps to deconfigure when operation is not specified.

Choices:

  • "present" ← (default)

  • "absent"

username

string

Graphiant portal username for authentication.

Required for password-based login when no valid bearer token is available from access_token or GRAPHIANT_ACCESS_TOKEN.

Attributes

Attribute

Support

Description

check_mode

Support: full

When run with --check, the module logs the exact payloads that would be pushed with a [check_mode] prefix so you can see what configuration would be applied. The module does not perform state comparison, so changed may be True even when the configuration is already applied.

Supports check mode. In check mode, no configuration is pushed to the devices but payloads that would be pushed are logged with [check_mode].

Notes

Note

  • Check mode (--check): No config is pushed; payloads that would be pushed are logged with [check_mode].

  • LAG Operations:

  • - configure: Configure LAG on physical interfaces (and optionally subinterfaces). Idempotent - creates new LAGs or updates existing ones.

  • - deconfigure: Delete ALL subinterfaces (if present) and then delete the main LAG interface. This is a complete cleanup operation that removes everything. Idempotent - skips non-existent LAGs and subinterfaces.

  • - add_lag_members: Add member interfaces to an existing LAG. Idempotent - skips members already added.

  • - remove_lag_members: Remove member interfaces from an existing LAG. Idempotent - skips members already removed.

  • - update_lacp_configs: Update LACP mode/timer. Idempotent - skips if config already matches desired state.

  • - delete_lag_subinterfaces: Delete specified VLAN subinterfaces under the LAG. Only deletes subinterfaces listed in the config file. Idempotent - skips non-existent LAGs and subinterfaces.

  • Configuration files support Jinja2 templating syntax for dynamic configuration generation.

  • The module automatically resolves device names to IDs.

  • Idempotency Details:

  • The module queries existing LAG state before making changes. For configure operations, duplicate alias assignments are automatically handled by removing the alias from the payload when it matches the existing alias. For member operations, existing members are checked and only necessary changes are applied. For LACP updates, current mode/timer are compared before pushing configuration. For deconfigure, all existing subinterfaces are automatically detected and deleted before removing the main LAG. For delete_lag_subinterfaces, only specified subinterfaces are deleted. For deconfigure, all existing subinterfaces are automatically detected and deleted before removing the main LAG. For delete_lag_subinterfaces, only specified subinterfaces are deleted.

  • Member interfaces must exist on the device; interface names in the config are resolved to interface IDs via device info.

See Also

See also

graphiant.naas.graphiant_interfaces

Manage LAN/WAN interface and circuit configuration

Examples

- name: Configure LAG
  graphiant.naas.graphiant_lag_interfaces:
    operation: configure
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true
  register: lag_result

- name: Add LAG members
  graphiant.naas.graphiant_lag_interfaces:
    operation: add_lag_members
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

- name: Remove LAG members
  graphiant.naas.graphiant_lag_interfaces:
    operation: remove_lag_members
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

- name: Update LACP settings
  graphiant.naas.graphiant_lag_interfaces:
    operation: update_lacp_configs
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

- name: Configure LAG subinterfaces (use configure operation with subinterfaces in config)
  graphiant.naas.graphiant_lag_interfaces:
    operation: configure
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

- name: Delete LAG subinterfaces
  graphiant.naas.graphiant_lag_interfaces:
    operation: delete_lag_subinterfaces
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

- name: Deconfigure LAG using state parameter
  graphiant.naas.graphiant_lag_interfaces:
    state: absent
    lag_config_file: "sample_lag_interface_config.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

Return Values

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

Key

Description

changed

boolean

Whether the operation made changes to the system.

Returned: always

Sample: true

lag_config_file

string

The LAG configuration file used for the operation.

Returned: always

Sample: "sample_lag_interface_config.yaml"

msg

string

Result message from the operation, including detailed logs when detailed_logs is enabled.

Returned: always

Sample: "Successfully configured LAG interfaces"

operation

string

The operation that was performed.

One of configure, deconfigure, add_lag_members, remove_lag_members, update_lacp_configs, or delete_lag_subinterfaces.

Returned: always

Sample: "configure"

Authors

  • Graphiant Team (@graphiant)

Collection links

  • Issue Tracker
  • Homepage
  • Repository (Sources)
  • Report an issue
  • View source code
  • Communication
Previous Next

© Copyright Ansible project contributors. Last updated on Apr 17, 2026.