graphiant.naas.graphiant_interfaces module – Manage Graphiant interfaces and circuits
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_interfaces.
New in graphiant.naas 25.11.0
Synopsis
This module provides comprehensive interface and circuit management capabilities for Graphiant Edge devices.
Supports LAN interface configuration and deconfiguration for subinterfaces.
Enables WAN interface and circuit management with static routes.
Supports circuit-only operations for updating static routes without reconfiguring interfaces.
All operations use Jinja2 templates for consistent configuration deployment.
Configuration files support Jinja2 templating for dynamic generation.
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 |
|
Path to the circuit configuration YAML file. Required for WAN and circuit operations ( Optional for LAN-only 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 circuit definitions with static routes and circuit configurations. |
|
If Supported for When Choices:
|
|
Enable detailed logging output for troubleshooting and monitoring. When enabled, provides comprehensive logs of all interface 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 interface 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 interface definitions with device names, interface names, and subinterface configurations. |
|
The specific interface operation to perform.
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
Interface Operations:
- LAN interfaces: Configure/deconfigure subinterfaces for LAN connectivity.
- WAN interfaces: Configure/deconfigure WAN circuits and interfaces together.
- Circuits only: Update circuit configurations including static routes without touching interfaces.
Configuration files support Jinja2 templating syntax for dynamic configuration generation.
The module automatically resolves device names to IDs and validates configurations.
Deconfigure operations are idempotent and safe to run multiple times.
Configure operations always push the desired config (they may report changed even if the device is already configured).
Check mode (
--check): No config is pushed; payloads that would be pushed are logged with[check_mode].LAN segment move: When an interface or subinterface is moved to a different LAN segment, the API requires a two-step push (segment-only then full config). The module does this automatically; in check mode both payloads are shown.
WAN static-route cleanup (important):
- Detaching a WAN interface from a circuit may be treated by the backend as a circuit removal.
If that circuit still has static routes, the operation can fail with:
‘error removing circuit “<name>”. Remove static routes first.’
-
deconfigure_wan_circuits_interfacesanddeconfigure_interfacesautomatically remove static routes first (when a circuit config is provided).- Use
deconfigure_circuitswhen you only want to remove static routes and keep interfaces/circuits attached.
See Also
See also
- graphiant.naas.graphiant_global_config
Configure global objects (LAN segments, VPN profiles) that may be referenced in interface configurations.
- graphiant.naas.graphiant_bgp
Configure BGP peering after interfaces are configured
Examples
- name: Configure all interfaces (LAN and WAN)
graphiant.naas.graphiant_interfaces:
operation: configure_interfaces
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: configure_result
- name: Configure LAN interfaces only
graphiant.naas.graphiant_interfaces:
operation: configure_lan_interfaces
interface_config_file: "sample_interface_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
- name: Configure WAN circuits and interfaces
graphiant.naas.graphiant_interfaces:
operation: configure_wan_circuits_interfaces
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
- name: Configure circuits only (update static routes)
graphiant.naas.graphiant_interfaces:
operation: configure_circuits
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
- name: Deconfigure circuits (remove static routes)
graphiant.naas.graphiant_interfaces:
operation: deconfigure_circuits
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
- name: Deconfigure WAN circuits and interfaces
graphiant.naas.graphiant_interfaces:
operation: deconfigure_wan_circuits_interfaces
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
- name: Deconfigure all interfaces
graphiant.naas.graphiant_interfaces:
operation: deconfigure_interfaces
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
- name: Deconfigure interfaces using state parameter
graphiant.naas.graphiant_interfaces:
state: absent
interface_config_file: "sample_interface_config.yaml"
circuit_config_file: "sample_circuit_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. Configure operations typically return Deconfigure operations may return Returned: always Sample: |
|
The circuit configuration file used for the operation. Only returned when circuit_config_file was provided. Returned: when applicable Sample: |
|
Whether only circuits were affected in the operation. Returned: always Sample: |
|
The interface 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 Returned: always Sample: |