Be more careful about loading

This commit is contained in:
Luke Murphy 2020-04-13 20:19:14 +02:00
parent 95e70fdfdd
commit 91763f13a0
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -1,15 +1,25 @@
--- ---
- 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: Check if the app config file exists
stat:
path: "{{ app_config_root }}/config.yml"
register: config_yml
- name: Load unencrypted variables - name: Load unencrypted variables
no_log: true no_log: true
when: config_yml.stat.exists
include_vars: include_vars:
ignore_unknown_extensions: true file: "{{ app_config_root }}/config.yml"
dir: "{{ item }}"
extensions:
- yml
- yaml
with_items:
- "{{ plugin_config_root }}" # vars.yml system variables
- "{{ app_config_root }}" # config.yml end-user variables
- name: Check if a vault directory exists - name: Check if a vault directory exists
stat: stat: