summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/project.yml
blob: b8574cf9d2a9a9ca473bc3f3eb395d7d6305186b (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
33
34
35
---
- 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)) }}"
    kaas_project_pods:        "{{ kaas_project_config.pods | default({}) }}"
    kaas_project_gids:        "{{ kaas_project_config.gids | default(kaas_openshift_gids) }}"
    kaas_project_uids:        "{{ kaas_project_config.uids | default(kaas_openshift_uids) }}"