• Blog
  • Ansible community forum
  • Documentation
Ansible Logo
Ansible Collections Documentation
Ansible collections

Collections:

  • Collection Index
    • Collections in the Skupper Namespace
      • Skupper.V2
        • Description
        • Plugin Index

Plugin indexes:

  • Index of all Modules

Reference indexes:

  • Index of all Collection Environment Variables
Ansible collections
  • Collection Index
  • Collections in the Skupper Namespace
  • Skupper.V2
  • skupper.v2.token module – Issue or retrieve access tokens and static links

skupper.v2.token module – Issue or retrieve access tokens and static links

Note

This module is part of the skupper.v2 collection (version 2.2.0).

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 skupper.v2. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: skupper.v2.token.

New in skupper.v2 2.0.0

  • Synopsis

  • Requirements

  • Parameters

  • Examples

  • Return Values

Synopsis

  • Manages Skupper Access Tokens and static links

  • Generates an AccessGrant and return a corresponding AccessToken (kubernetes platform only)

  • Returns an AccessToken for an existing AccessGrant (kubernetes platform only)

  • Retrieves a static Link based on provided subject alternative name or host (podman, docker and linux platforms)

Requirements

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

  • python >= 3.9

  • kubernetes >= 24.2.0

  • PyYAML >= 3.11

Parameters

Parameter

Comments

context

string

The name of a context found in the config file.

expiration_window

string

Duration of the generated AccessGrant

Sample values 10m, 2h

Only used when platform is kubernetes and type is token

Default: "15m"

host

string

Static link hostname

Only used when platform is podman, docker, linux

kubeconfig

string

Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the Kubernetes client will attempt to load the default configuration file from ~/.kube/config.

name

string

Name of the AccessGrant (to be generated or consumed) and AccessToken (kubernetes platform only) when using type token

Name of the Link and Certificate (to be generated or consumed) (kubernetes platform only) when using type link

Name of a RouterAccess (podman, docker or linux platforms)

namespace

string

Use to specify an object namespace.

platform

string

The platform to use when manipulating resources

Choices:

  • "kubernetes" ← (default)

  • "podman"

  • "docker"

  • "linux"

redemptions_allowed

integer

The number of claims the generated AccessGrant is valid for

Only used when platform is kubernetes and type is token

Default: 1

type

string

Type of token to produce or consume

Only meaningful when platform is kubernetes

Always set to link when platform is podman, docker, linux

Choices:

  • "token" ← (default)

  • "link"

Examples

# Retrieve or issue an AccessToken (if my-grant does not exist or can be redeemed)
- name: Retrieve or issue my-grant AccessToken
  skupper.v2.token:
    name: my-grant
    platform: kubernetes
    namespace: west

# Retrieve or issue a Link (if my-link does not exist)
- name: Retrieve or create my-link Link
  skupper.v2.token:
    name: my-link
    type: link
    platform: kubernetes
    namespace: west

# Retrieving or generate a static Link
- name: Retrieve token
  skupper.v2.token:
    name: west-link
    type: link
    platform: kubernetes
    namespace: west

# Retrieving an accesstoken for any valid accessgrant
- name: Retrieve token
  skupper.v2.token:
    platform: kubernetes
    namespace: west

# Retrieving a Link for any existing site client certificate
- name: Retrieve Link
  skupper.v2.token:
    platform: kubernetes
    type: link
    namespace: west

# Retrieve a static Link for host my.nonkube.host
- name: Retrieve a static link
  skupper.v2.token:
    host: my.nonkube.host
    platform: podman

Return Values

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

Key

Description

token

string

AccessToken resource (yaml)

Link and Secret (yaml)

Returned: success

Authors

  • Fernando Giorgetti (@fgiorgetti)

Collection links

  • Issue Tracker
  • Homepage
  • Repository (Sources)
Previous Next

© Copyright Ansible contributors.