hcp-ansible/playbooks/tasks/consul_vars.yml

32 lines
990 B
YAML
Raw Normal View History

---
# hashistack configuration merging for consul
- name: "Consul | Merge stringified configuration"
vars:
_config_to_merge: "{{ hashi_consul_configuration_string }}"
ansible.builtin.set_fact:
hashi_consul_configuration: "{{
hashi_consul_configuration |
combine(_config_to_merge|from_yaml)
}}"
when: hashi_consul_configuration_string is defined
- name: "Consul | Merge addresses configuration"
vars:
_config_to_merge: "{{ consul_address_configuration }}"
ansible.builtin.set_fact:
hashi_consul_configuration: "{{
hashi_consul_configuration |
combine(_config_to_merge)
}}"
when: consul_address_configuration is defined
- name: "Consul | Merge extra configuration settings"
vars:
_config_to_merge: "{{ consul_extra_configuration }}"
ansible.builtin.set_fact:
hashi_consul_configuration: "{{
hashi_consul_configuration |
combine(_config_to_merge)
}}"
when: consul_extra_configuration is defined