summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-04-11 00:30:58 +0200
committerSuren A. Chilingaryan <csa@suren.me>2018-04-11 00:30:58 +0200
commitbc6b5cb5ad7dec5158e0005433b02a951daf9191 (patch)
treeb3125932ed468aac2b34124fe4be361a8de7fbe7 /roles
parent5a15f65db3dfb245919bdd534e93bd711db2eb60 (diff)
downloadands-bc6b5cb5ad7dec5158e0005433b02a951daf9191.tar.gz
ands-bc6b5cb5ad7dec5158e0005433b02a951daf9191.tar.bz2
ands-bc6b5cb5ad7dec5158e0005433b02a951daf9191.tar.xz
ands-bc6b5cb5ad7dec5158e0005433b02a951daf9191.zip
Support executing custom scripts and provide mode to update just ADEI template
Diffstat (limited to 'roles')
-rw-r--r--roles/ands_kaas/tasks/do_project.yml6
-rw-r--r--roles/ands_kaas/tasks/do_script.yml10
-rw-r--r--roles/ands_kaas/tasks/ocscript.yml2
-rw-r--r--roles/ands_kaas/tasks/project.yml2
4 files changed, 16 insertions, 4 deletions
diff --git a/roles/ands_kaas/tasks/do_project.yml b/roles/ands_kaas/tasks/do_project.yml
index 71a54ad..e64e9e3 100644
--- a/roles/ands_kaas/tasks/do_project.yml
+++ b/roles/ands_kaas/tasks/do_project.yml
@@ -5,7 +5,9 @@
- name: "Run OC script"
include_tasks: ocscript.yml
run_once: true
- when: kaas_project_config.oc is defined
+ vars:
+ script: "{{ kaas_project_script }}"
+ when: kaas_project_script is defined
- block:
- name: Configure storage
@@ -21,5 +23,5 @@
include_tasks: do_apps.yml
run_once: true
when:
- - kaas_project_config.oc is undefined
+ - kaas_project_script is undefined
diff --git a/roles/ands_kaas/tasks/do_script.yml b/roles/ands_kaas/tasks/do_script.yml
new file mode 100644
index 0000000..7dc9dad
--- /dev/null
+++ b/roles/ands_kaas/tasks/do_script.yml
@@ -0,0 +1,10 @@
+---
+- name: Ensure OpenShift template directory exists
+ file: path="{{ kaas_template_path }}" state="directory" mode=0755 owner=root group=root
+
+- name: "Run OC script"
+ include_tasks: ocscript.yml
+ run_once: true
+ vars:
+ script: "{{ kaas_script | default(kaas_project_script) }}"
+
diff --git a/roles/ands_kaas/tasks/ocscript.yml b/roles/ands_kaas/tasks/ocscript.yml
index 6890f43..077e92b 100644
--- a/roles/ands_kaas/tasks/ocscript.yml
+++ b/roles/ands_kaas/tasks/ocscript.yml
@@ -2,7 +2,7 @@
- include_tasks: ocitem.yml
# delegate_to: "{{ groups.masters[0] }}"
run_once: true
- with_items: "{{ kaas_project_config.oc }}"
+ with_items: "{{ script }}"
loop_control:
loop_var: ocitem
\ No newline at end of file
diff --git a/roles/ands_kaas/tasks/project.yml b/roles/ands_kaas/tasks/project.yml
index 879f34a..2c05afd 100644
--- a/roles/ands_kaas/tasks/project.yml
+++ b/roles/ands_kaas/tasks/project.yml
@@ -63,4 +63,4 @@
kaas_project_gids: "{{ kaas_project_config.gids | default(kaas_openshift_gids) }}"
kaas_project_uids: "{{ kaas_project_config.uids | default(kaas_openshift_uids) }}"
kaas_blockvol_info: "{{ block_info }}"
- \ No newline at end of file
+ kaas_project_script: "{{ kaas_project_config.oc | default(omit) }}"