community.okd.openshift_process – Process an OpenShift template.openshift.io/v1 Template¶
Note
This plugin is part of the community.okd collection (version 1.1.2).
To install it use: ansible-galaxy collection install community.okd
.
To use it in a playbook, specify: community.okd.openshift_process
.
New in version 0.3.0: of community.okd
Synopsis¶
Processes a specified OpenShift template with the provided template.
Templates can be provided inline, from a file, or specified by name and namespace in the cluster.
Analogous to oc process.
For CRUD operations on Template resources themselves, see the community.okd.k8s module.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
openshift >= 0.11.0
PyYAML >= 3.11
Parameters¶
Notes¶
Note
The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit https://github.com/openshift/openshift-restclient-python
To avoid SSL certificate validation errors when
validate_certs
is True, the full certificate chain for the API server must be provided viaca_cert
or in the kubeconfig file.
Examples¶
- name: Process a template in the cluster
community.okd.openshift_process:
name: nginx-example
namespace: openshift # only needed if using a template already on the server
parameters:
NAMESPACE: openshift
NAME: test123
state: rendered
register: result
- name: Create the rendered resources using apply
community.okd.k8s:
namespace: default
definition: '{{ item }}'
wait: yes
apply: yes
loop: '{{ result.resources }}'
- name: Process a template with parameters from an env file and create the resources
community.okd.openshift_process:
name: nginx-example
namespace: openshift
namespace_target: default
parameter_file: 'files/nginx.env'
state: present
wait: yes
- name: Process a local template and create the resources
community.okd.openshift_process:
src: files/example-template.yaml
parameter_file: files/example.env
namespace_target: default
state: present
- name: Process a local template, delete the resources, and wait for them to terminate
community.okd.openshift_process:
src: files/example-template.yaml
parameter_file: files/example.env
namespace_target: default
state: absent
wait: yes
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Fabian von Feilitzsch (@fabianvf)