feat(vars): add check to load global vars file before running deployment
This commit is contained in:
parent
27df88ae09
commit
34bb4bd7ad
@ -8,6 +8,7 @@
|
|||||||
- name: "debug"
|
- name: "debug"
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ hashi_vault_configuration.listener }}"
|
msg: "{{ hashi_vault_configuration.listener }}"
|
||||||
|
|
||||||
- name: "Vault"
|
- name: "Vault"
|
||||||
when: enable_vault | bool
|
when: enable_vault | bool
|
||||||
when: "'vault_servers' in group_names"
|
when: "'vault_servers' in group_names"
|
||||||
|
@ -6,9 +6,21 @@
|
|||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Load global variables"
|
- name: "Load global variables"
|
||||||
ansible.builtin.include_vars:
|
block:
|
||||||
dir: "{{ configuration_directory }}"
|
- name: "Stat global configuration file"
|
||||||
files_matching: "{{ configuration_global_vars_file }}"
|
ansible.builtin.stat:
|
||||||
|
path: "{{ configuration_directory }}/{{ configuration_global_vars_file }}"
|
||||||
|
register: _global_config_file
|
||||||
|
|
||||||
|
- name: "Make sure global configuration file exists"
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- _global_config_file.stat.exists
|
||||||
|
|
||||||
|
- name: "Load global variables"
|
||||||
|
ansible.builtin.include_vars:
|
||||||
|
dir: "{{ configuration_directory }}"
|
||||||
|
files_matching: "{{ configuration_global_vars_file }}"
|
||||||
|
|
||||||
- name: "Load group specific variables"
|
- name: "Load group specific variables"
|
||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
|
Loading…
Reference in New Issue
Block a user