Use named inclusion
This commit is contained in:
parent
3ffa51b00e
commit
995f06d055
@ -24,6 +24,7 @@
|
||||
when: config_yml.stat.exists
|
||||
include_vars:
|
||||
file: "{{ app_config_root }}/config.yml"
|
||||
name: "config"
|
||||
register: config_include
|
||||
|
||||
- name: Check if an application vault directory exists
|
||||
@ -37,6 +38,7 @@
|
||||
include_vars:
|
||||
ignore_unknown_extensions: true
|
||||
dir: "{{ app_config_root }}/vault"
|
||||
name: "vault"
|
||||
extensions:
|
||||
- yml
|
||||
register: vault_include
|
||||
@ -53,17 +55,17 @@
|
||||
|
||||
- name: Create the vault variable dictionary
|
||||
set_fact:
|
||||
vault: "{{ vault_include.ansible_facts }}"
|
||||
vault: "{{ vault_include.ansible_facts.vault }}"
|
||||
|
||||
- name: Create the config variable dictionary
|
||||
set_fact:
|
||||
config:
|
||||
{
|
||||
"vars": "{{ config_include.ansible_facts.vars | default([]) }}",
|
||||
"db": "{{ config_include.ansible_facts.db | default([]) }}",
|
||||
"env": "{{ config_include.ansible_facts.env | default([]) }}",
|
||||
"volumes": "{{ config_include.ansible_facts.volumes | default([]) }}",
|
||||
"templates": "{{ config_include.ansible_facts.templates | default([]) }}",
|
||||
"vars": "{{ config_include.ansible_facts.config.vars | default([]) }}",
|
||||
"db": "{{ config_include.ansible_facts.config.db | default([]) }}",
|
||||
"env": "{{ config_include.ansible_facts.config.env | default([]) }}",
|
||||
"volumes": "{{ config_include.ansible_facts.config.volumes | default([]) }}",
|
||||
"templates": "{{ config_include.ansible_facts.config.templates | default([]) }}",
|
||||
}
|
||||
|
||||
- name: Debug variable dictionaries
|
||||
@ -72,5 +74,4 @@
|
||||
with_items:
|
||||
- "{{ config }}"
|
||||
- "{{ dokku }}"
|
||||
- "{{ vars }}"
|
||||
when: debug is defined and debug == true
|
||||
|
Reference in New Issue
Block a user