infra/roles/prepare-config/tasks/main.yml

30 lines
668 B
YAML
Raw Normal View History

2018-10-02 09:12:23 +03:00
---
- name: include environment definition
include_vars:
file: "conf/envs/{{env_name}}.yml"
name: env
- set_fact:
env: "{{env}}"
- name: import config for stack
block:
- include_vars:
file: "conf/stacks/{{stack_name}}/apps.yml"
name: as
- include_vars:
file: "conf/stacks/{{stack_name}}/stack.yml"
name: st
- set_fact:
gen_nodes: []
- name: genrate nodes list
include_tasks: generate_nodes.yml
with_items: "{{st.nodes}}"
- set_fact:
stack: "{{ {}|combine( st | combine({'nodes': gen_nodes|list_to_dict}) )|combine(as) }}"
# stack: "{{ {}|combine( st )|combine({'apps': as}) }}"
#- debug: msg="{{stack}}"