graphiant.naas.graphiant_local_extranet module – Manage Graphiant Local Extranet policies
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_local_extranet.
New in graphiant.naas 26.7.0
Synopsis
Manages Local Extranet policies, which share a LAN segment (the provider/shared-service side) with other LAN segments (the consumer/branch side) across sites within the same enterprise.
Unlike graphiant.naas.graphiant_data_exchange (cross-enterprise B2B peering), Local Extranet is single-tenant with no counterpart enterprise involved.
Supports creating, updating, and deleting policies. After a successful create or update, the policy is automatically pushed to devices — there is no separate “apply” step.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.7
graphiant-sdk >= 26.10.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. File must contain local_extranet_policies list. |
|
Enable detailed logging output for troubleshooting and monitoring. When enabled, provides comprehensive logs of all Local Extranet operations. Logs are captured and included in the Choices:
|
|
Graphiant portal host URL for API connectivity. Example: “https://api.graphiant.com” |
|
The specific Local Extranet operation to perform.
prefixSet restricts which subnets are advertised{{ “:” }} omit it to share/allow all prefixes, or provide entries (each with an ipPrefix and optional maskLower/ maskUpper) to restrict shared prefixes to specific subnets. Optional targetDevices limits which devices a policy is pushed to (defaults to all applicable devices).
For query operations (policies_summary, policy_device_status, lan_segments_usage, nat_usage), use graphiant.naas.graphiant_local_extranet_info 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
Configuration files support Jinja2 templating syntax for dynamic configuration generation.
The module automatically resolves names to IDs for LAN segments, sites, and devices.
All operations are idempotent and safe to run multiple times without creating duplicates.
Check mode (
--check) is supported: config load, validation, and name-to-ID resolution runnormally, but write operations are skipped and payloads are logged with a
[check_mode]prefix.Use graphiant.naas.graphiant_local_extranet_info to query policy summaries and device status.
See Also
See also
- graphiant.naas.graphiant_global_config
Configure global objects (LAN segments) required for Local Extranet
- graphiant.naas.graphiant_sites
Configure sites required for Local Extranet policies
- graphiant.naas.graphiant_local_extranet_info
Query Local Extranet policy summaries and device status
- graphiant.naas.graphiant_data_exchange
Manage cross-enterprise (B2B) Data Exchange services, customers, matches, and invitations
Examples
- name: Create Local Extranet policies
graphiant.naas.graphiant_local_extranet:
operation: create_policies
config_file: "sample_local_extranet_policies.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: create_result
- name: Display policy creation result
ansible.builtin.debug:
msg: "{{ create_result.msg }}"
- name: Preview Local Extranet policy updates (check + diff)
graphiant.naas.graphiant_local_extranet:
operation: update_policies
config_file: "sample_local_extranet_policies_update.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: update_result
# Run playbook with: ansible-playbook playbook.yml --check --diff
- name: Update Local Extranet policies
graphiant.naas.graphiant_local_extranet:
operation: update_policies
config_file: "sample_local_extranet_policies_update.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: update_result
- name: Display policy update result
ansible.builtin.debug:
msg: "{{ update_result.msg }}"
- name: Delete Local Extranet policies
graphiant.naas.graphiant_local_extranet:
operation: delete_policies
config_file: "sample_local_extranet_policies.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 configuration file used for the operation. Returned: when applicable Sample: |
|
Ansible Returned for For new items, For updates, Returned: when playbook uses Sample: |
|
Result message from the operation, including detailed logs when Returned: always Sample: |
|
The operation that was performed. One of Returned: always Sample: |
|
Result data from the operation. Returned: when applicable Sample: |