Authentication

Authentication

Environment Variables

This collection uses environment variables for the general configuration, such as:

// Env Variables
export SYNTROPY_API_SERVER=https://controller-prod-server.syntropystack.com
export SYNTROPY_API_TOKEN='{API Authorization token}'

You can refer to this article to learn how to retrieve an access token.

YAML Override

It is possible to override these environment variables by specifying api_url and/or api_token module options.
The most convenient way to do that is to specify SYNTROPY_API_SERVER in the environment variable and provide api_token by using Ansible vault.

You can either call modules by their Fully Qualified Collection Namespace (FQCN), such as syntropynet.syntropy.syntropy_facts, or you can call modules by their short name if you list the syntropynet.syntropy collection in the playbook's collections keyword:

---
  - name: Retrieve facts about the account
    syntropynet.syntropy.syntropy_facts:
      api_url: '{{ api_url }}'
      api_token: '{{ api_token }}'
    register: facts

Did this page help you?