graphiant.naas.graphiant_global_config module – Manage Graphiant global configuration objects

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_global_config.

New in graphiant.naas 25.11.0

Synopsis

  • This module provides comprehensive global configuration object management for Graphiant devices.

  • Supports multiple global object types: prefix sets, BGP & Graphiant filters, SNMP services, syslog services, NTP services, IPFIX services, VPN profiles, and LAN segments.

  • Can manage all object types together using general operations or specific object types individually.

  • All operations use Jinja2 templates for consistent configuration deployment.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.7

  • graphiant-sdk >= 26.3.0

Parameters

Parameter

Comments

access_token

string

Bearer token for API authentication (for example, from graphiant login, which opens a browser for sign-in (SSO or non-SSO) and retrieves the token).

If not passed as a module argument, the collection reads GRAPHIANT_ACCESS_TOKEN (set after graphiant login when you source ~/.graphiant/env.sh).

When a bearer token is present (module argument or environment), it takes precedence over username and password.

If no valid token is available, the module authenticates with username and password when both are supplied.

config_file

string / required

Path to the global 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 the appropriate global object definitions based on the operation type.

detailed_logs

boolean

Enable detailed logging output for troubleshooting and monitoring.

When enabled, provides comprehensive logs of all global configuration operations.

Logs are captured and included in the result_msg for display using ansible.builtin.debug module.

Choices:

  • false ← (default)

  • true

host

aliases: base_url

string / required

Graphiant portal host URL for API connectivity.

Example: “https://api.graphiant.com

operation

string

The specific global configuration operation to perform.

configure: Configure all global objects (automatically detects all types in the file).

deconfigure: Deconfigure all global objects (automatically detects all types in the file).

configure_prefix_sets: Configure global prefix sets only.

deconfigure_prefix_sets: Deconfigure global prefix sets only.

configure_bgp_filters: Configure global BGP filters (routing policies) only.

deconfigure_bgp_filters: Deconfigure global BGP filters only.

configure_graphiant_filters: Configure global Graphiant filters (GraphiantIn/GraphiantOut) only.

deconfigure_graphiant_filters: Deconfigure global Graphiant filters only.

configure_snmp_services: Configure global SNMP services only.

deconfigure_snmp_services: Deconfigure global SNMP services only.

configure_syslog_services: Configure global syslog services only.

deconfigure_syslog_services: Deconfigure global syslog services only.

configure_ntps: Configure global NTP objects only.

deconfigure_ntps: Deconfigure global NTP objects only.

configure_ipfix_services: Configure global IPFIX services only.

deconfigure_ipfix_services: Deconfigure global IPFIX services only.

configure_vpn_profiles: Configure global VPN profiles only.

deconfigure_vpn_profiles: Deconfigure global VPN profiles only.

configure_lan_segments: Configure global LAN segments only.

deconfigure_lan_segments: Deconfigure global LAN segments only.

configure_site_lists: Configure global site lists only.

deconfigure_site_lists: Deconfigure global site lists only.

Choices:

  • "configure"

  • "deconfigure"

  • "configure_prefix_sets"

  • "deconfigure_prefix_sets"

  • "configure_bgp_filters"

  • "deconfigure_bgp_filters"

  • "configure_graphiant_filters"

  • "deconfigure_graphiant_filters"

  • "configure_snmp_services"

  • "deconfigure_snmp_services"

  • "configure_syslog_services"

  • "deconfigure_syslog_services"

  • "configure_ntps"

  • "deconfigure_ntps"

  • "configure_ipfix_services"

  • "deconfigure_ipfix_services"

  • "configure_vpn_profiles"

  • "deconfigure_vpn_profiles"

  • "configure_lan_segments"

  • "deconfigure_lan_segments"

  • "configure_site_lists"

  • "deconfigure_site_lists"

password

string

Graphiant portal password for authentication.

Required for password-based login when no valid bearer token is available from access_token or GRAPHIANT_ACCESS_TOKEN.

state

string

The desired state of the global configuration objects.

present: Maps to configure when operation not specified.

absent: Maps to deconfigure when operation not specified.

Choices:

  • "present" ← (default)

  • "absent"

username

string

Graphiant portal username for authentication.

Required for password-based login when no valid bearer token is available from access_token or GRAPHIANT_ACCESS_TOKEN.

Attributes

Attribute

Support

Description

check_mode

Support: full

When run with --check, the module logs the exact payloads that would be pushed with a [check_mode] prefix so you can see what configuration would be applied. The module does not perform state comparison, so changed may be True even when the configuration is already applied.

Supports check mode. In check mode, no configuration is pushed to the devices but payloads that would be pushed are logged with [check_mode].

Notes

Note

  • Check mode (--check): No config is pushed; payloads that would be pushed are logged with [check_mode].

  • Global Configuration Operations:

  • - General operations (configure, deconfigure): - Automatically detect and process all configuration types in the YAML file.

  • - Specific operations (configure_*, deconfigure_*): - Process only the specific configuration type.

  • Configuration files support Jinja2 templating syntax for dynamic configuration generation.

  • The module automatically resolves names to IDs for sites, LAN segments, and other referenced objects.

  • All operations are idempotent and safe to run multiple times.

  • Global objects can be referenced by other modules (BGP, Sites, Data Exchange) after creation.

  • When both operation and state are provided, operation takes precedence.

See Also

See also

graphiant.naas.graphiant_bgp

Attach global BGP filters to BGP peers

graphiant.naas.graphiant_sites

Attach global objects to sites

graphiant.naas.graphiant_data_exchange

Use global LAN segments and VPN profiles in Data Exchange workflows

Examples

- name: Configure all global objects (general operation)
  graphiant.naas.graphiant_global_config:
    operation: configure
    config_file: "sample_global_prefix_lists.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global prefix sets (specific operation)
  graphiant.naas.graphiant_global_config:
    operation: configure_prefix_sets
    config_file: "sample_global_prefix_lists.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global BGP filters
  graphiant.naas.graphiant_global_config:
    operation: configure_bgp_filters
    config_file: "sample_global_bgp_filters.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global Graphiant filters
  graphiant.naas.graphiant_global_config:
    operation: configure_graphiant_filters
    config_file: "sample_global_graphiant_filters.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Deconfigure global Graphiant filters
  graphiant.naas.graphiant_global_config:
    operation: deconfigure_graphiant_filters
    config_file: "sample_global_graphiant_filters.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global LAN segments
  graphiant.naas.graphiant_global_config:
    operation: configure_lan_segments
    config_file: "sample_global_lan_segments.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global VPN profiles
  graphiant.naas.graphiant_global_config:
    operation: configure_vpn_profiles
    config_file: "sample_global_vpn_profiles.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global NTP objects
  graphiant.naas.graphiant_global_config:
    operation: configure_ntps
    config_file: "sample_global_ntp.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Configure global site lists
  graphiant.naas.graphiant_global_config:
    operation: configure_site_lists
    config_file: "sample_global_site_lists.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"
    detailed_logs: true

- name: Deconfigure global prefix sets
  graphiant.naas.graphiant_global_config:
    operation: deconfigure_prefix_sets
    config_file: "sample_global_prefix_lists.yaml"
    host: "{{ graphiant_host }}"
    username: "{{ graphiant_username }}"
    password: "{{ graphiant_password }}"

- name: Deconfigure all global objects using state parameter
  graphiant.naas.graphiant_global_config:
    state: absent
    config_file: "sample_global_prefix_lists.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

changed

boolean

Whether the operation made changes to the system.

true for all configure/deconfigure operations.

Returned: always

Sample: true

config_file

string

The configuration file used for the operation.

Returned: always

Sample: "sample_global_prefix_lists.yaml"

msg

string

Result message from the operation, including detailed logs when detailed_logs is enabled.

Returned: always

Sample: "Successfully configured all global objects"

operation

string

The operation that was performed.

One of configure, deconfigure, or a specific configure_*/deconfigure_* operation.

Returned: always

Sample: "configure_prefix_sets"

Authors

  • Graphiant Team (@graphiant)