graphiant.naas.graphiant_gateway_services module – Manage Graphiant Gateway Services (cloud gateway and connectivity)
Note
This module is part of the graphiant.naas collection (version 26.10.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_gateway_services.
New in graphiant.naas 26.9.0
Synopsis
Manages Graphiant Gateway Services via
POST/PUT/DELETE /v1/gateways. Two service types are supported under the top-levelgatewayServiceskey in the config file:cloudGateway(cloud peering for AWS, Azure, GCP, and Oracle) andconnectivity(site-to-site IPSec VPN gateway,ipsecGatewayPeers).The
createoperation is idempotent create-or-update. Services that do not exist are created; existing connectivity services are updated in place when the config changes, and services that already match are skipped. To change a service, edit the config file and re-runcreate.Update is not supported for cloud gateway services (
create/deleteonly). Only connectivity services can be updated; a re-run ofcreateagainst an unchanged cloud gateway is skipped rather than updated.Region names, LAN segment names, and speeds in the config file are resolved to the API
regionId/vrfIdand the S-prefixed speed enum (e.g.1Gbps->S1Gbps) before the request is sent. Region, LAN segment, and any connectivityvpnProfilenames are validated against the enterprise before any gateway is pushed, failing fast with the list of available values when a name is not found.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.7
graphiant-sdk >= 26.10.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 in the task result message. Choices:
|
|
Re-push every matching Tunnel Applies to Choices:
|
|
Path to the YAML configuration file containing the Relative paths resolve using the collection config path (see |
|
Graphiant portal host URL for API connectivity. Example: “https://api.graphiant.com” |
|
Operation to perform.
When omitted, it is derived from Choices:
|
|
Graphiant portal password for authentication. Required for password-based login when no valid bearer token is available from |
|
Desired state, used to derive Choices:
|
|
Graphiant portal username for authentication. Required for password-based login when no valid bearer token is available from |
|
Connectivity BGP MD5 passwords, keyed by gateway name ( Used to fill Structure: Default: |
|
Connectivity tunnel pre-shared keys, keyed by gateway name then peer name then tunnel. Each tunnel Structure: Default: |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full In check mode, no configuration is pushed; the module still reads current state to determine whether changes would be made. |
Supports check mode. |
|
Support: full When the playbook runs with |
Supports Ansible’s |
Notes
Note
Configuration files support Jinja2 templating syntax for dynamic value substitution.
With
ansible-playbook --check, writes are skipped butchangedreflects whether an apply would create, update, or delete at least one service. Use--diffto preview the pending changes.
See Also
See also
- graphiant.naas.graphiant_site_to_site_vpn
Per-edge site-to-site IPSec VPN (device-level, distinct from gateway connectivity).
- graphiant.naas.graphiant_global_config
Global routing policies (filters) referenced by cloud gateway
routingPolicy.
Examples
- name: Create or update gateway services from YAML
graphiant.naas.graphiant_gateway_services:
operation: create
gateway_services_config_file: "sample_gateway_services_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: gateway_services_create_result
- name: Preview changes without applying (dry run)
graphiant.naas.graphiant_gateway_services:
operation: create
gateway_services_config_file: "sample_gateway_services_config.yaml"
access_token: "{{ graphiant_access_token }}"
check_mode: true
diff: true
- name: Delete gateway services defined in YAML
graphiant.naas.graphiant_gateway_services:
operation: delete
gateway_services_config_file: "sample_gateway_services_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
register: gateway_services_delete_result
# Connectivity tunnel PSK sourcing — three modes (see also sample_gateway_services_config.yaml):
# 1. DIRECT INPUT : set psk inline in the config file, e.g. tunnel1: { psk: "my-preshared-key" }
# 2. VAULT : leave psk null in the config and provide it via vault_gateway_ipsec_psks below
# 3. API AUTO-FILL: leave psk null in the config with no vault entry; the portal generates one
- name: Create gateway services with vault-supplied PSK (mode 2)
graphiant.naas.graphiant_gateway_services:
operation: create
gateway_services_config_file: "sample_gateway_services_config.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
vault_gateway_ipsec_psks:
test: # gateway name (ipsecGatewayPeers.name)
peer-1: # peer-<N>, 1-based over remotePeers
tunnel2: "{{ vault_gateway_test_peer1_tunnel2_psk }}"
register: gateway_services_create_result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether at least one gateway service was created, updated, or deleted. Returned: always |
|
Names of gateway services that were created. Returned: when operation is |
|
Names of gateway services that were deleted. Returned: when operation is |
|
Structured payload from the manager (service lists, diff plan, etc.). Returned: always |
|
Ansible Returned: when playbook uses |
|
Path to the YAML file used. Returned: always |
|
Human-readable result (includes detailed logs when enabled). Returned: always |
|
Operation performed ( Returned: always |
|
Names of gateway services skipped because state already matched. Returned: always |
|
Names of connectivity gateway services that were updated in place. Returned: when operation is |