summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/project.yml
blob: f7eb1df60e85559248eb3e7fe3096699e245281e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
- name: Load global variables
  include_vars: "{{kaas_project_path}}/vars/globals.yml" 
  when: path | is_file
  vars:
    path: "{{ kaas_project_path }}/vars/globals.yml"

- name: Load variables
  include_vars: dir="{{kaas_project_path}}/vars" name="var_{{kaas_project}}_config"
  when: path | is_dir
  vars:
    path: "{{ kaas_project_path }}/vars"

- set_fact: "var_{{kaas_project}}_config={{var_empty}}"
  vars:
    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:
    var_name: "var_{{kaas_project}}_config"
    kaas_project_config: "{{ hostvars[inventory_hostname][var_name] }}"
    kaas_project_volumes: "{{ kaas_project_config.volumes | default(kaas_project_config.extra_volumes | default({}) | combine(kaas_openshift_volumes)) }}"