summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/project.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_kaas/tasks/project.yml')
-rw-r--r--roles/ands_kaas/tasks/project.yml83
1 files changed, 17 insertions, 66 deletions
diff --git a/roles/ands_kaas/tasks/project.yml b/roles/ands_kaas/tasks/project.yml
index 002596b..40b5180 100644
--- a/roles/ands_kaas/tasks/project.yml
+++ b/roles/ands_kaas/tasks/project.yml
@@ -4,73 +4,24 @@
when: "'{{kaas_project_path}}/vars/globals.yml' | is_file"
- name: Load variables
- include_vars: dir="{{kaas_project_path}}/vars" name="kaas_project_config"
+ include_vars: dir="{{kaas_project_path}}/vars" name="var_{{kaas_project}}_config"
when: "'{{kaas_project_path}}/vars' | is_dir"
-- name: Ensure OpenShift template directory exists
- file: path="{{ kaas_template_path }}" state="directory" mode=0755 owner=root group=root
-
-- name: Configure KaaS volumes
- include: volume.yml
- run_once: true
- delegate_to: "{{ groups.masters[0] }}"
- with_dict: "{{ kaas_project_config.volumes | default(kaas_openshift_volumes) }}"
- loop_control:
- loop_var: osv
- vars:
- query: "[*].volumes.{{osv.value.volume}}.mount"
- mntpath: "{{ (ands_storage_domains | json_query(query)) }}"
- path: "{{ mntpath[0] ~ (osv.value.path | default('')) }}"
- name: "{{osv.key}}"
- volume: "{{osv.value}}"
- when: ( mntpath | length ) > 0
-
-- name: Copy static configuration
- include: sync_all.yml
- run_once: true
- delegate_to: "{{ groups.masters[0] }}"
- with_items: "{{ lookup('pipe', search).split('\n') }}"
- loop_control:
- loop_var: osv_path
+- set_fact: "var_{{kaas_project}}_config={{var_empty}}"
vars:
- search: "find {{ kaas_project_path }}/files/ -type d -mindepth 1 -maxdepth 1"
- osv: "{{ osv_path | basename }}"
- pvar: "kaas_{{ osv }}_path"
- local_path: "{{ osv_path }}"
- remote_path: "{{ hostvars[inventory_hostname][pvar] }}"
- when:
- - osv in kaas_openshift_volumes
- - hostvars[inventory_hostname][pvar] is defined
-
-- name: Configure KaaS files
- include: file.yml
- run_once: true
- delegate_to: "{{ groups.masters[0] }}"
- with_items: "{{ kaas_project_config.files | default(ands_openshift_files) }}"
- loop_control:
- loop_var: file
+ var_empty:
+ pods: {}
+ var_name: "var_{{kaas_project}}_config"
+ when: hostvars[inventory_hostname][var_name] is not defined
+
+#- debug: msg="{{kaas_project_path}}"
+#- debug:
+# msg="{{kaas_project_config}}"
+# vars:
+# var_name: "var_{{kaas_project}}_config"
+# kaas_project_config: "{{hostvars[inventory_hostname][var_name]}}"
+
+- include_tasks: do_project.yml
vars:
- pvar: "kaas_{{ file.osv }}_path"
- path: "{{ hostvars[inventory_hostname][pvar] }}/{{ file.path }}"
- when: file.osv in ( kaas_project_config.volumes | default(kaas_openshift_volumes) )
-
-- name: Load OpenSSL keys
- include: keys.yml
- delegate_to: "{{ groups.masters[0] }}"
- run_once: true
- with_dict: "{{ kaas_project_config.pods }}"
- loop_control:
- loop_var: pod
-
-- name: "Run OC script"
- include: ocscript.yml
- delegate_to: "{{ groups.masters[0] }}"
- run_once: true
- when: kaas_project_config.oc is defined
-
-- name: "Configure all templates"
- include: templates.yml
- delegate_to: "{{ groups.masters[0] }}"
- run_once: true
- when: kaas_project_config.oc is undefined
-
+ var_name: "var_{{kaas_project}}_config"
+ kaas_project_config: "{{hostvars[inventory_hostname][var_name]}}"