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
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 |
|---|---|
The name of a context found in the config file. |
|
Duration of the generated AccessGrant Sample values Only used when platform is Default: |
|
Static link hostname Only used when platform is |
|
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 of the AccessGrant (to be generated or consumed) and AccessToken (kubernetes platform only) when using type Name of the Link and Certificate (to be generated or consumed) (kubernetes platform only) when using type Name of a RouterAccess (podman, docker or linux platforms) |
|
Use to specify an object namespace. |
|
The platform to use when manipulating resources Choices:
|
|
The number of claims the generated AccessGrant is valid for Only used when platform is Default: |
|
Type of token to produce or consume Only meaningful when platform is Always set to Choices:
|
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 |
|---|---|
AccessToken resource (yaml) Link and Secret (yaml) Returned: success |