forked from redhat-cop/openshift-applier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Jinja templates, closes redhat-cop#119
- Loading branch information
1 parent
06d2629
commit aec058c
Showing
10 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
{% for environment in environments %} | ||
- apiVersion: v1 | ||
kind: ProjectRequest | ||
metadata: | ||
name: {{ namespace_metadata.NAMESPACE }}-file-{{ environment }} | ||
description: {{ namespace_metadata.NAMESPACE_DESCRIPTION }} (file) - {{ environment }} | ||
displayName: {{ namespace_metadata.NAMESPACE_DISPLAY_NAME }} (file) - {{ environment }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Template | ||
labels: | ||
template: projectrequest-template | ||
message: |- | ||
The following project/namespace has been created: ${NAMESPACE} | ||
metadata: | ||
annotations: | ||
description: |- | ||
ProjectRequest Template | ||
creationTimestamp: null | ||
name: ${NAMESPACE} | ||
objects: | ||
{% for environment in environments %} | ||
- apiVersion: v1 | ||
kind: ProjectRequest | ||
metadata: | ||
name: ${NAMESPACE}-template-{{ environment }} | ||
description: '${NAMESPACE_DESCRIPTION} (template) - {{ environment }}' | ||
displayName: '${NAMESPACE_DISPLAY_NAME} (template )- {{ environment }}' | ||
{% endfor %} | ||
parameters: | ||
- description: Name | ||
displayName: Name | ||
name: NAMESPACE | ||
required: true | ||
- description: DisplayName | ||
displayName: DisplayName | ||
name: NAMESPACE_DISPLAY_NAME | ||
required: true | ||
- description: Description | ||
displayName: Description | ||
name: NAMESPACE_DESCRIPTION |
24 changes: 24 additions & 0 deletions
24
tests/inventories/jinja-templates/group_vars/seed-hosts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
|
||
environments: | ||
- dev | ||
- test | ||
- prod | ||
|
||
namespace_metadata: | ||
NAMESPACE: oa-ci-jinja-templates | ||
NAMESPACE_DISPLAY_NAME: OpenShift Applier Jinja Templates Test 1 (displayName) | ||
NAMESPACE_DESCRIPTION: OpenShift Applier Jinja Templates Test 1 (description) | ||
|
||
openshift_cluster_content: | ||
- object: projectrequest | ||
content: | ||
- name: jinja-project-test-template | ||
template: "{{ inventory_dir }}/../../files/jinja-templates/projectrequest_template.yml" | ||
params_from_vars: "{{ namespace_metadata }}" | ||
action: create | ||
jinjatemplate: true | ||
- name: jinja-project-test-file | ||
file: "{{ inventory_dir }}/../../files/jinja-templates/projectrequest_file.yml" | ||
action: create | ||
jinjatemplate: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
|
||
ansible_connection: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
[seed-hosts] | ||
localhost |