graphiant.naas.graphiant_data_exchange module – Manage Graphiant Data Exchange services, customers, matches, and invitations
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_data_exchange.
New in graphiant.naas 25.11.0
Synopsis
This module provides comprehensive Data Exchange management capabilities for Graphiant’s B2B peering platform.
Enables creating and deleting Data Exchange services and customers.
Provides service-to-customer matching operations with automatic match response file management.
Supports invitation acceptance with gateway service deployment and VPN configuration.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.7
graphiant-sdk >= 26.3.0
tabulate
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 YAML configuration file for the operation. Required for 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. For per service attaches Graphiant routing policies to devices (device names resolved to IDs). For For For per acceptance attaches Graphiant routing policies to gateway devices (device names resolved to IDs). Match responses are saved to output/ directory near the configuration file. |
|
Enable detailed logging output for troubleshooting and monitoring. When enabled, provides comprehensive logs of all Data Exchange operations. Logs are captured and included in the Choices:
|
|
Graphiant portal host URL for API connectivity. Example: “https://api.graphiant.com” |
|
Path to the matches responses JSON file for match ID lookup. Optional for Can be an absolute path or relative path. Relative paths are resolved using the configured config_path. This file is automatically generated by File contains match details including customer_id, service_id, match_id, and status. Match ID resolution priority:
|
|
The specific Data Exchange operation to perform.
Configuration file must contain data_exchange_services list with service definitions. Services define peering services with LAN segments, sites, and service prefixes. Optional policy.globalObjectOps: keys are device names (resolved to device IDs) or device IDs; values can include routingPolicyOps to attach Graphiant filters per device (e.g. Policy-DC1-Primary: Attach). Configure Graphiant filters first with graphiant.naas.graphiant_global_config and configure_graphiant_filters.
Configuration file must contain data_exchange_customers list with customer definitions. Customers can be non-Graphiant peers that can be invited to connect to services.
Configuration file must contain data_exchange_matches list with match definitions. Automatically saves match responses to JSON file for use in Workflow 4. Updates existing match entries or appends new ones based on customer_name and service_name.
Configuration file must contain data_exchange_acceptances list with acceptance details. Requires Supports dry-run mode for validation without API calls. Configures full IPSec gateway deployment with dual tunnels, static routing, and VPN profiles. For query operations (get_services_summary, get_customers_summary, get_service_health), use graphiant.naas.graphiant_data_exchange_info module instead. 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 |
Supported. In check mode, no API writes are performed; payloads that would be sent are logged with a |
Notes
Note
Data Exchange Workflows:
- Workflow 1 (Create Services): Create Data Exchange services that can be shared with customers.
- Workflow 2 (Create Customers): Create Data Exchange customers (nonGraphiant peers).
- Workflow 3 (Match Services): Match services to customers and establish peering relationships.
- Workflow 4 (Accept Invitation): Accept service invitations for non Graphiant customers.
Configuration files support Jinja2 templating syntax for dynamic configuration generation.
Match responses are automatically saved to JSON files in the output directory near the configuration file.
The module automatically resolves names to IDs for sites, LAN segments, services, customers, and regions.
All operations are idempotent and safe to run multiple times without creating duplicates.
For accept_invitation operation, minimum 2 gateways per region are required for redundancy.
Check mode (
--check) is supported. In check mode, the module runs all logic (config load, validation,name-to-ID resolution) but the API client skips write operations and logs payloads with
[check_mode].Use
--checkto validate accept_invitation without making API calls.
See Also
See also
- graphiant.naas.graphiant_interfaces
Configure interfaces and circuits for Data Exchange prerequisites
- graphiant.naas.graphiant_global_config
Configure global objects (LAN segments, VPN profiles) required for Data Exchange
- graphiant.naas.graphiant_sites
Configure sites required for Data Exchange services
- graphiant.naas.graphiant_data_exchange_info
Query Data Exchange services, customers, and service health information
Examples
- name: Workflow 1 - Create Data Exchange services
graphiant.naas.graphiant_data_exchange:
operation: create_services
config_file: "de_workflows_configs/sample_data_exchange_services.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: create_services_result
- name: Display services creation result
ansible.builtin.debug:
msg: "{{ create_services_result.msg }}"
- name: Workflow 1 - Create services with Jinja2 template (scale testing)
graphiant.naas.graphiant_data_exchange:
operation: create_services
config_file: "de_workflows_configs/sample_data_exchange_services_scale.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
- name: Workflow 2 - Create Data Exchange customers
graphiant.naas.graphiant_data_exchange:
operation: create_customers
config_file: "de_workflows_configs/sample_data_exchange_customers.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: create_customers_result
- name: Display customers creation result
ansible.builtin.debug:
msg: "{{ create_customers_result.msg }}"
- name: Workflow 2 - Create customers with Jinja2 template (scale testing)
graphiant.naas.graphiant_data_exchange:
operation: create_customers
config_file: "de_workflows_configs/sample_data_exchange_customers_scale2.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
- name: Workflow 3 - Match Data Exchange services to customers
graphiant.naas.graphiant_data_exchange:
operation: match_service_to_customers
config_file: "de_workflows_configs/sample_data_exchange_matches.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: match_result
- name: Display match result
ansible.builtin.debug:
msg: "{{ match_result.msg }}"
- name: Workflow 4 - Accept Data Exchange service invitation (check mode)
graphiant.naas.graphiant_data_exchange:
operation: accept_invitation
config_file: "de_workflows_configs/sample_data_exchange_acceptance.yaml"
matches_file: "de_workflows_configs/output/sample_data_exchange_matches_responses_latest.json"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: accept_result
# Run playbook with: ansible-playbook playbook.yml --check
- name: Display acceptance result
ansible.builtin.debug:
msg: "{{ accept_result.msg }}"
- name: Workflow 4 - Accept Data Exchange service invitation (apply)
graphiant.naas.graphiant_data_exchange:
operation: accept_invitation
config_file: "de_workflows_configs/sample_data_exchange_acceptance.yaml"
matches_file: "de_workflows_configs/output/sample_data_exchange_matches_responses_latest.json"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: accept_result
- name: Display acceptance result
ansible.builtin.debug:
msg: "{{ accept_result.msg }}"
- name: Delete Data Exchange customers (must be deleted before services)
graphiant.naas.graphiant_data_exchange:
operation: delete_customers
config_file: "de_workflows_configs/sample_data_exchange_customers.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
- name: Delete Data Exchange services
graphiant.naas.graphiant_data_exchange:
operation: delete_services
config_file: "de_workflows_configs/sample_data_exchange_services.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
- name: Complete Data Exchange workflow (all four workflows)
block:
- name: Workflow 1 - Create services
graphiant.naas.graphiant_data_exchange:
operation: create_services
config_file: "de_workflows_configs/sample_data_exchange_services.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: create_services_result
- name: Workflow 2 - Create customers
graphiant.naas.graphiant_data_exchange:
operation: create_customers
config_file: "de_workflows_configs/sample_data_exchange_customers.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: create_customers_result
- name: Workflow 3 - Match services to customers
graphiant.naas.graphiant_data_exchange:
operation: match_service_to_customers
config_file: "de_workflows_configs/sample_data_exchange_matches.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: match_result
- name: Workflow 4 - Accept invitations
graphiant.naas.graphiant_data_exchange:
operation: accept_invitation
config_file: "de_workflows_configs/sample_data_exchange_acceptance.yaml"
matches_file: "de_workflows_configs/output/sample_data_exchange_matches_responses_latest.json"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: accept_result
- name: Display workflow results
ansible.builtin.debug:
msg: "{{ item.msg }}"
loop:
- "{{ create_services_result }}"
- "{{ create_customers_result }}"
- "{{ match_result }}"
- "{{ accept_result }}"
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 configuration file used for the operation. Only returned for operations that require a configuration file. Returned: when applicable Sample: |
|
Result message from the operation, including detailed logs when For summary operations, includes tabulated output for easy reading. For health operations, includes tabulated health status for all matched customers. Returned: always Sample: |
|
The operation that was performed. One of Returned: always Sample: |
|
Result data from the operation, including structured data for summary and health operations. For summary operations, contains service/customer details with IDs, names, status, and counts. For health operations, contains health metrics for all matched customers. Returned: when applicable Sample: |