Attempt a new variables arrangement strategy
This commit is contained in:
		| @ -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 }}" | ||||
|  | ||||
		Reference in New Issue
	
	Block a user