skupper.v2.resource module – Place skupper resources (yaml) in the provided namespace
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.resource.
New in skupper.v2 2.0.0
Synopsis
Place skupper resources (yaml) in the provided namespace. If platform is kubernetes (default) the resources are applied to the respective namespace. In case a different platform is used, the resources will be placed into the correct location for the namespace on the file system.
Note
This module has a corresponding action plugin.
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. |
|
YAML representation of a custom resource. It can contain multiple YAML documents. |
|
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. |
|
Use to specify an object namespace. |
|
Path where resources are located (yaml and yml files). Path can be a directory, a file or an http URL. If remote is true (default is URLs are always fetch from the inventory host. Mutually exclusive with def |
|
The platform to use when manipulating resources Choices:
|
|
For non-kubernetes platforms (for example Other documents in the same definition are applied first. With When Choices:
|
|
Determines if the resources are located at the inventory host instead of the control node. Choices:
|
|
Choices:
|
Examples
# Applying resources to a kubernetes cluster
- name: Apply Skupper Resources
skupper.v2.resource:
path: /home/user/west/crs
platform: kubernetes
namespace: west
# Applying remote resources to a kubernetes cluster
- name: Apply Skupper Resources
skupper.v2.resource:
path: /remote/home/user/west/crs
remote: true
platform: kubernetes
namespace: west
# Applying resources to a non-kube namespace
- name: Apply Skupper Resources
skupper.v2.resource:
path: /home/user/west/crs
platform: podman
namespace: west
# Define a single resource
- name: Define resources for west site
skupper.v2.resource:
namespace: west
def: |
---
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: west
spec:
linkAccess: default
---
apiVersion: skupper.io/v2alpha1
kind: Listener
metadata:
name: backend
spec:
host: backend
port: 8080
routingKey: backend
- name: Redeem access token on a non-kubernetes site (apply Secret/Link only)
skupper.v2.resource:
namespace: east
platform: podman
def: "{{ access_token_yaml }}"
redeem: true
register: out
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
List of dicts Returned: when one or more AccessToken redemptions failed |
|
List of YAML strings per redeemed token when Returned: when redeem is used on non-kubernetes and AccessToken documents were present |