benschubert.infrastructure.authentik_token module – Allows administration of Authentik tokens

Note

This module is part of the benschubert.infrastructure collection (version 0.0.1).

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 benschubert.infrastructure.

To use it in a playbook, specify: benschubert.infrastructure.authentik_token.

Synopsis

Parameters

Parameter

Comments

authentik_token

string / required

The token used to authenticate against the Authentik server

authentik_url

string / required

The URL at which to contact the Authentik server

ca_path

string

PEM formatted file that contains a CA certificate to be used for validation

state

string

Whether the entity should exist or not

Choices:

  • "present" ← (default)

  • "absent"

timeout

integer

The timeout to set when contacting the Authentik Server.

If your server is slow to respond, it might be necessary to bump this

Default: 10

token

dictionary / required

The configuration for the specified token

description

string

A description to attach to the token

expiring

boolean

Whether the token expires or not

Choices:

  • false

  • true ← (default)

identifier

string / required

The unique identifier for the token

intent

string / required

The intended usage for the token:

app_password: for authenticating against other applications

api: for authenticating with the Authentik API

Choices:

  • "app_password"

  • "api"

user

integer / required

The primary key of the user owning the token

validate_certs

boolean

If false, SSL certificates will not be validated.

This should only set to false used on personally controlled sites using self-signed certificates.

Choices:

  • false

  • true ← (default)

Examples

- name: Create a token for user 2
  benschubert.infrastructure.authentik_token:
    authentik_token: <my-secret-token>
    authentik_url: https://authentik.test/
    token:
      identifier: my-test-token
      intent: app_password
      user: 2
      description: A token used during tests
      expiring: false

Return Values

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

Key

Description

data

dictionary

The information returned by the Authentik API

Returned: always

Sample: {"description": "A token used during tests", "expiring": false, "identifier": "my-test-token", "intent": "app_password", "user": 6}

Authors

  • Benjamin Schubert (@benjaminschubert)