Add openshift_process module (#44)

* Initial pass at openshift_process module. Render-only

* fix sanity test

* Add ability to create/delete resources rendered by template

* fix sanity tests

* add more tests and fix .env parser

* Add more tests

* Make multiline parsing work properly

* Add test for creating templates

* Template APIs require namespace to be provided whether or not the template exists

* add docs

* Update plugins/modules/openshift_process.py

Co-authored-by: Timothy Appnel <tima@ansible.com>

Co-authored-by: Timothy Appnel <tima@ansible.com>
This commit is contained in:
Fabian von Feilitzsch
2020-10-12 13:36:39 -04:00
committed by GitHub
parent 308235e032
commit 74ac82e76d
9 changed files with 627 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
#
NAME=example
# Multiline values shouldn't break things
export CONTENT=This is a long message\
that may take one or more lines to parse\
but should still work without issue
# This shouldn't throw an error
UNUSED=

View File

@@ -0,0 +1,12 @@
# Want to make sure comments don't break it
export NAME=test123
NAMESPACE=openshift
# Blank lines should be fine too
# Equals in comments shouldn't break things=True
MEMORY_LIMIT=1Gi

View File

@@ -0,0 +1,34 @@
---
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: simple-example-test
message: |-
The following configmaps have been created in your project: ${NAME}.
metadata:
annotations:
description: A super basic template for testing
openshift.io/display-name: Super basic template
openshift.io/provider-display-name: Red Hat, Inc.
tags: quickstart,examples
name: simple-example
objects:
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
description: Big example
name: ${NAME}
data:
content: "${CONTENT}"
parameters:
- description: The name assigned to the ConfigMap
displayName: Name
name: NAME
required: true
value: example
- description: The value for the content key of the configmap
displayName: Content
name: CONTENT
required: true
value: ''