graphiant.naas.graphiant_public_vif module – Manage Graphiant gateway Public VIF (local data exchange) services
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_public_vif.
New in graphiant.naas 26.8.0
Synopsis
Manages gateway Public VIF services — a producer LAN segment (VRF) exposed over BGP through one or more Graphiant-managed gateways, in a chosen cloud region/provider, to a cloud router and to one or more consumer LAN segments.
Supports creating, updating, and deleting services.
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 public_vif_services list. |
|
Enable detailed logging output for troubleshooting and monitoring. When enabled, provides comprehensive logs of all Public VIF operations. Logs are captured and included in the Choices:
|
|
Graphiant portal host URL for API connectivity. Example: “https://api.graphiant.com” |
|
The specific Public VIF operation to perform.
Optional coveringPrefixes summarizes the LAN routes advertised, and advertisement scopes which sites/site lists may consume the service (all symmetric sites if omitted).
For query operations (services_summary, service_details), use graphiant.naas.graphiant_public_vif_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 |
|
Dict of service name to device name to BGP MD5 password (create_services/ update_services only). Pass from playbook vars loaded from encrypted vault_secrets.yml; secrets in memory only. Keys must match the service Default: |
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.
Names given for lanSegment, region, advertisement.sites, and advertisement.siteLists are resolved to IDs.
gatewayBgpNeighbors (per-gateway BGP peering) and natPrefixStrategy (per-gateway NAT prefix) share the same key space — the gateway device name or ID — and every key in one should have a matching entry in the other. consumerLanSegments is a separate key space, keyed by consumer LAN segment name. See
sample_public_vif_services.yaml.Before any write, each configured gateway is checked against what’s actually provisioned for the resolved region/storageProvider; each neighbor’s localInterface is checked against that gateway’s real interfaces; and the resolved lanSegment is checked against what’s configured on those gateways. A bad reference fails fast with a clear error instead of a confusing API rejection or a silently wrong VRF.
Each gatewayBgpNeighbors entry’s
enabled/bfdfields are not user-configurable — the module always enables the neighbor and disables BFD (not yet supported for Public VIF).Vault (create_services/update_services only):
vault_public_vif_bgp_md5_passwords, keyed byservice name->gateway name, fills a neighbor’smd5Passwordwhen left null in YAML (YAML value wins if set). Load from an encrypted vault file with ansible.builtin.include_vars (no_log true); see configs/vault_secrets.yml.example.md5Password, from either source, is always redacted as********in logs and--diff.create_services/delete_servicesare idempotent, matched by serviceName.update_servicesis a full replace, not a merge — the config must contain the complete desired service; anything omitted (a field, or a gatewayBgpNeighbors/ consumerLanSegments/natPrefixStrategy entry) is removed. It does not compare against live state first, so every run reportschanged=true— seesample_public_vif_services_update.yaml.Check mode (
--check) validates and resolves everything normally; only the write is skipped, with the payload logged under a[check_mode]prefix.Use graphiant.naas.graphiant_public_vif_info to query service summaries and details.
See Also
See also
- graphiant.naas.graphiant_global_config
Configure global objects (LAN segments) required for Public VIF
- graphiant.naas.graphiant_sites
Configure sites required for Public VIF advertisement scoping
- graphiant.naas.graphiant_public_vif_info
Query Public VIF service summaries and details
- graphiant.naas.graphiant_local_extranet
Manage intra-enterprise Local Extranet LAN segment sharing
- graphiant.naas.graphiant_data_exchange
Manage cross-enterprise (B2B) Data Exchange services, customers, matches, and invitations
Examples
- name: Create Public VIF services
graphiant.naas.graphiant_public_vif:
operation: create_services
config_file: "sample_public_vif_services.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: create_result
- name: Display service creation result
ansible.builtin.debug:
msg: "{{ create_result.msg }}"
- name: Create Public VIF services with BGP MD5 passwords from Ansible Vault (leave md5Password null in YAML)
graphiant.naas.graphiant_public_vif:
operation: create_services
config_file: "sample_public_vif_services.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
vault_public_vif_bgp_md5_passwords: "{{ vault_public_vif_bgp_md5_passwords | default({}) }}"
register: create_result
- name: Preview Public VIF service updates (check + diff)
graphiant.naas.graphiant_public_vif:
operation: update_services
config_file: "sample_public_vif_services_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 Public VIF services
graphiant.naas.graphiant_public_vif:
operation: update_services
config_file: "sample_public_vif_services_update.yaml"
host: "{{ graphiant_host }}"
username: "{{ graphiant_username }}"
password: "{{ graphiant_password }}"
detailed_logs: true
register: update_result
- name: Display service update result
ansible.builtin.debug:
msg: "{{ update_result.msg }}"
- name: Delete Public VIF services
graphiant.naas.graphiant_public_vif:
operation: delete_services
config_file: "sample_public_vif_services.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 services, 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: |