avantra.core.login module – authentication operations

Note

This module is part of the avantra.core collection (version 23.0.3).

To install it, use: ansible-galaxy collection install avantra.core.

To use it in a playbook, specify: avantra.core.login.

New in avantra.core 23.0.0

Synopsis

  • With this module a authentication token can be fetched from an defined Avantra API endpoint url together with a valid username and password. You can then use the token for other tasks.

Note

This module has a corresponding action plugin.

Parameters

Parameter

Comments

avantra_api_password

string / required

The password or API key for the selected Avantra user.

We highly recommend to use Ansible Vaults to protect you sensitive content.

avantra_api_url

string / required

A valid URL pointing to an Avantra UI.

For example https://avantra-ui/xn

avantra_api_user

string / required

Valid Avantra user principal.

Notes

Note

  • This module does NOT support check_mode.

See Also

See also

Avantra Documentation

The official Avantra documentation.

Examples

# Authenticate against endpoint and print registered token
- name: Authenticate against Avantra API
  avantra.core.login:
    avantra_api_url: https://avantra-ui/xn
    avantra_api_user: <username>
    avantra_api_password: <password>
  register: auth

- name: Print the authentication token
  ansible.builtin.debug:
    var: auth

- name: Get information about a server
  avantra.core.server_info:
    token: "{{auth.token}}"
    server_name: aservername
    customer_name: acustomername

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

token

string

The token to be used during a playbook.

Returned: success

Sample: "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJtaXMyIiwicm9sZXMiOltdLCJpYXQiOjE2NjY4OTg3NzEsImV4cCI6MTY2NjkyMDM3MX0..."

Authors

  • Michael Szediwy (@avantra-mis)