feat(vault): start working on configuration merging to allow customization

This commit is contained in:
Bertrand Lanson 2024-01-05 23:58:30 +01:00
parent df5802647e
commit ba6bab9a92
4 changed files with 20 additions and 0 deletions

View File

@ -14,6 +14,12 @@
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: tasks/load_vars.yml file: tasks/load_vars.yml
- name: "Debug"
ansible.builtin.debug:
msg: "{{ hashi_vault_configuration }}"
- ansible.builtin.fail:
- name: "Vault" - name: "Vault"
when: when:
- enable_vault | bool - enable_vault | bool

View File

@ -131,6 +131,7 @@ vault_service_registration_configuration:
############################# #############################
# vault plugins configuration # vault plugins configuration
############################# #############################
vault_enable_plugins: false
######################### #########################

View File

@ -64,6 +64,13 @@
loop_var: item loop_var: item
delegate_to: localhost delegate_to: localhost
- name: "Merge vault configurations"
ansible.builtin.import_tasks:
file: "vault_vars.yml"
when:
- enable_vault | bool
- "'vault_servers' in group_names"
- name: "Debug" - name: "Debug"
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ vault_cluster_name }}" msg: "{{ vault_cluster_name }}"

View File

@ -0,0 +1,6 @@
---
# hashistack configuration merging for vault
- name: "Merge service registration configuration"
ansible.builtin.set_fact:
hashi_vault_configuration: "{{ hashi_vault_configuration | combine({'service_registration': vault_service_registration_configuration}) }}"
when: vault_enable_service_registration