hcp-ansible/roles/vault/tasks/merge_variables.yml

78 lines
2.3 KiB
YAML
Raw Normal View History

---
2024-10-06 10:18:07 +00:00
# task/merge_variables file for vault
- name: "Vault | Merge listener configuration"
block:
- name: "Vault | Merge tls listener configuration"
vars:
_config_to_merge: "{{ vault_tls_listener_configuration }}"
ansible.builtin.set_fact:
vault_listener_configuration: >-
{{
vault_listener_configuration |
zip(vault_tls_listener_configuration) |
map('combine', list_merge='append', recursive=true) |
list
}}
when: vault_enable_tls
- name: "Vault | Merge extra listener configuration"
vars:
_config_to_merge: "{{ vault_extra_listener_configuration }}"
ansible.builtin.set_fact:
vault_listener_configuration: >-
{{
vault_listener_configuration +
vault_extra_listener_configuration
}}
- name: "Vault | Add certificates directory to extra_files_dir"
ansible.builtin.set_fact:
vault_extra_files_list: "{{
vault_extra_files_list +
vault_certificates_extra_files_dir
| unique
| sort
}}"
- name: "Vault | Merge service registration configuration"
vars:
_config_to_merge:
service_registration: "{{ vault_service_registration_configuration }}"
ansible.builtin.set_fact:
vault_configuration: "{{
vault_configuration |
combine(_config_to_merge, recursive=true)
}}"
when: vault_enable_service_registration
- name: "Vault | Merge plugins configuration"
vars:
_config_to_merge:
plugin_directory: "{{ vault_plugins_directory }}"
ansible.builtin.set_fact:
vault_configuration: "{{
vault_configuration |
combine(_config_to_merge, recursive=true)
}}"
when: vault_enable_plugins
- name: "Vault | Merge logging configuration"
vars:
_config_to_merge: "{{ vault_log_to_file_configuration }}"
ansible.builtin.set_fact:
vault_configuration: "{{
vault_configuration |
combine(_config_to_merge, recursive=true)
}}"
when: vault_enable_log_to_file
- name: "Vault | Merge extra configuration settings"
vars:
_config_to_merge: "{{ vault_extra_configuration }}"
ansible.builtin.set_fact:
vault_configuration: "{{
vault_configuration |
combine(_config_to_merge, recursive=true)
}}"
when: vault_extra_configuration is defined