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
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 |
|---|---|
Bearer token for API authentication (for example, from If not passed as a module argument, the collection reads When a bearer token is present (module argument or environment), it takes precedence over If no valid token is available, the module authenticates with |
|
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:
|
|
Graphiant portal host URL for API connectivity. Example: “https://api.graphiant.com” |
|
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. |
|
The specific LAG operation to perform.
“
Note: To add/configure LAG subinterfaces, use Choices:
|
|
Graphiant portal password for authentication. Required for password-based login when no valid bearer token is available from |
|
Graphiant portal username for authentication. Required for password-based login when no valid bearer token is available from |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full When run with |
Supports check mode. In check mode, no configuration is pushed to the devices but payloads that would be pushed are logged with |
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 |
|---|---|
Whether the operation made changes to the system. Returned: always Sample: |
|
The LAG configuration file used for the operation. Returned: always Sample: |
|
Result message from the operation, including detailed logs when Returned: always Sample: |
|
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: |