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"
|
||||||
|
@ -5,6 +5,18 @@
|
|||||||
gather_facts: true
|
gather_facts: true
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: "Load global variables"
|
||||||
|
block:
|
||||||
|
- name: "Stat global configuration 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"
|
- name: "Load global variables"
|
||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
dir: "{{ configuration_directory }}"
|
dir: "{{ configuration_directory }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user