Group plays to hooks
This commit is contained in:
42
plays/commonlib/vars.yml
Normal file
42
plays/commonlib/vars.yml
Normal file
@ -0,0 +1,42 @@
|
||||
---
|
||||
- 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_mariadb_db_addr: "dokku-mariadb-{{ app }}"
|
||||
dokku_mariadb_db_user: "mariadb"
|
||||
dokku_hostname: "{{ lookup('file', '/home/dokku/HOSTNAME') }}"
|
||||
|
||||
- name: Check if the application config file exists
|
||||
stat:
|
||||
path: "{{ app_config_root }}/config.yml"
|
||||
register: config_yml
|
||||
|
||||
- name: Load unencrypted configuration variables
|
||||
no_log: true
|
||||
when: config_yml.stat.exists
|
||||
include_vars:
|
||||
file: "{{ app_config_root }}/config.yml"
|
||||
|
||||
- name: Check if an application vault directory exists
|
||||
stat:
|
||||
path: "{{ app_config_root }}/vault"
|
||||
register: vault_dir
|
||||
|
||||
- name: Load application encrypted vault variables
|
||||
no_log: true
|
||||
when: vault_dir.stat.exists
|
||||
include_vars:
|
||||
ignore_unknown_extensions: true
|
||||
dir: "{{ app_config_root }}/vault"
|
||||
extensions:
|
||||
- yml
|
Reference in New Issue
Block a user