Attempt a new variables arrangement strategy

This commit is contained in:
Luke Murphy 2020-04-14 15:06:37 +02:00
parent 48a7781423
commit f8e0e01afd
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -36,8 +36,10 @@
include_vars:
ignore_unknown_extensions: true
dir: "{{ app_config_root }}/vault"
name: vault
extensions:
- yml
register: vault_include
- name: Create the dokku variable dictionary
set_fact:
@ -55,3 +57,19 @@
with_items:
- "{{ vars }}"
when: debug is defined and debug == true
# Note(decentral1se): this has to be done like this through the hostvars
# interface because of the way Ansible forces us to work here. There is a bug
# report out on this: https://github.com/ansible/ansible/issues/36024
- name: Create config variable dictionary
set_fact:
config:
db: "{{ hostvars[dokku.hostname].db | default([]) }}"
env: "{{ hostvars[dokku.hostname].env | default([]) }}"
templates: "{{ hostvars[dokku.hostname].templates | default([]) }}"
vars: "{{ hostvars[dokku.hostname].vars | default([]) }}"
volumes: "{{ hostvars[dokku.hostname].volumes | default([]) }}"
- name: Create vault variable dictionary
set_fact:
vault: "{{ vault_include.ansible_facts.vault }}"