avantra.core.login (24.0.0) — module

authentication operations

| "added in version" 23.0.0 of avantra.core"

Authors: Michael Szediwy (@avantra-mis)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install avantra.core:==24.0.0


Add to requirements.yml

  collections:
    - name: avantra.core
      version: 24.0.0

Description

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.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print the authentication token
  ansible.builtin.debug:
    var: auth
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get information about a server
  avantra.core.server_info:
    token: "{{auth.token}}"
    server_name: aservername
    customer_name: acustomername

Inputs

    
avantra_api_url:
    description:
    - A valid URL pointing to an Avantra UI.
    - For example C(https://avantra-ui/xn)
    required: true
    type: str

avantra_api_user:
    description:
    - Valid Avantra user principal.
    required: true
    type: str

avantra_api_password:
    description:
    - The password or API key for the selected Avantra user.
    - We highly recommend to use Ansible Vaults to protect you sensitive content.
    required: true
    type: str

Outputs

token:
  description: The token to be used during a playbook.
  returned: success
  sample: eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJtaXMyIiwicm9sZXMiOltdLCJpYXQiOjE2NjY4OTg3NzEsImV4cCI6MTY2NjkyMDM3MX0...
  type: str

See also