summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-08-28 23:44:22 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-08-28 23:44:22 +0200
commite7175b16015060b2210e425db223b5a811b55806 (patch)
tree70c19f44cdcb8595663124bafba9a5352dfce74d
parent79e60f2f201e1330a2716825dac985abb7a2bef0 (diff)
downloadands-e7175b16015060b2210e425db223b5a811b55806.tar.gz
ands-e7175b16015060b2210e425db223b5a811b55806.tar.bz2
ands-e7175b16015060b2210e425db223b5a811b55806.tar.xz
ands-e7175b16015060b2210e425db223b5a811b55806.zip
Support parameters in KaaS apps
-rw-r--r--roles/ands_kaas/tasks/do_apps.yml1
-rw-r--r--roles/ands_kaas/tasks/project.yml2
-rw-r--r--roles/ands_kaas/tasks/templates.yml1
-rw-r--r--roles/ands_kaas/templates/50-kaas-app-pods.yml.j23
4 files changed, 7 insertions, 0 deletions
diff --git a/roles/ands_kaas/tasks/do_apps.yml b/roles/ands_kaas/tasks/do_apps.yml
index ffcecfe..5883ff8 100644
--- a/roles/ands_kaas/tasks/do_apps.yml
+++ b/roles/ands_kaas/tasks/do_apps.yml
@@ -18,3 +18,4 @@
load: "{{ app.load | default(false) }}"
pods: "{{ app.pods | default({}) }}"
builders: "{{ app.builders | default({}) }}"
+ parameters: "{{ app.parameters | default({}) }}"
diff --git a/roles/ands_kaas/tasks/project.yml b/roles/ands_kaas/tasks/project.yml
index f1c596b..149a102 100644
--- a/roles/ands_kaas/tasks/project.yml
+++ b/roles/ands_kaas/tasks/project.yml
@@ -16,6 +16,7 @@
var_empty:
pods: {}
builders: {}
+ parameters: {}
var_name: "var_{{kaas_project}}_config"
when: hostvars[inventory_hostname][var_name] is not defined
@@ -61,6 +62,7 @@
kaas_project_local_volumes: "{{ kaas_project_config.local_volumes | default({}) }}"
kaas_project_builders: "{{ kaas_project_config.builders | default({}) }}"
kaas_project_pods: "{{ kaas_project_config.pods | default({}) }}"
+ kaas_project_parameters: "{{ kaas_project_config.parameters | default({}) }}"
kaas_project_apps: "{{ kaas_project_config.apps | default({}) }}"
kaas_project_gids: "{{ kaas_project_config.gids | default(kaas_openshift_gids) }}"
kaas_project_uids: "{{ kaas_project_config.uids | default(kaas_openshift_uids) }}"
diff --git a/roles/ands_kaas/tasks/templates.yml b/roles/ands_kaas/tasks/templates.yml
index 07b71ea..86f0d4a 100644
--- a/roles/ands_kaas/tasks/templates.yml
+++ b/roles/ands_kaas/tasks/templates.yml
@@ -23,6 +23,7 @@
load: false
pods: "{{ kaas_project_pods }}"
builders: "{{ kaas_project_builders }}"
+ parameters: "{{ kaas_project_parameters }}"
loop_control:
loop_var: tmpl_name
diff --git a/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2 b/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2
index 2174962..97f620d 100644
--- a/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2
+++ b/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2
@@ -3,6 +3,9 @@
{% set app = app | default('{}') %}
apiVersion: v1
kind: Template
+{% if parameters | length %}
+parameters: {{ parameters | to_json }}
+{% endif %}
metadata:
name: {{ appname | default(kaas_project) }}-pods
annotations: