---
# Note(decentral1se): please note that the majority of the vars that are
# referenced in this play are passed in via --extra-vars definitions in the
# functions script
- name: Check if internal system variables exists
stat:
path: "{{ plugin_config_root }}/vars.yml"
register: vars_yml
- name: Load internal system variables
no_log: true
when: vars_yml.stat.exists
include_vars:
file: "{{ plugin_config_root }}/vars.yml"
- name: Export internal deployment variables
set_fact:
dokku:
{
app: "{{ app }}",
mariadb_addr: "dokku-mariadb-{{ app }}",
mariadb_user: "mariadb",
hostname: "{{ lookup('file', '/home/dokku/HOSTNAME') }}",
}
- name: Check if the application config file exists
path: "{{ app_config_root }}/config.yml"
register: config_yml
- name: Load unencrypted configuration variables
when: config_yml.stat.exists
file: "{{ app_config_root }}/config.yml"
- name: Check if an application vault directory exists
path: "{{ app_config_root }}/vault"
register: vault_dir
- name: Load application encrypted vault variables
when: vault_dir.stat.exists
ignore_unknown_extensions: true
dir: "{{ app_config_root }}/vault"
name: "vault"
extensions:
- yml
register: vault_include
- name: Load vault variables into vault dictionary
vault: "{{ vault_include.ansible_facts }}"