Refactor templating logic
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-07-09 09:18:13 +02:00
parent 2be42989e5
commit 3a2dbe572e

View File

@ -21,17 +21,18 @@
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
- name: Inject chart values into ansible var files - block:
ansible.builtin.blockinfile:
path: /opt/firstboot/ansible/vars/metacluster.yml - name: Aggregate chart_values into dict
block: | ansible.builtin.set_fact:
{{ item.key }}: chart_values: "{{ chart_values | default({}) | combine({ item.key: (item.value.helm.chart_values | default('~')) }) }}"
{{ item.value.helm.chart_values | default(omit) }}
marker: "# {mark} ANSIBLE MANAGED BLOCK -- {{ item.key }}"
loop: "{{ lookup('ansible.builtin.dict', components) }}" loop: "{{ lookup('ansible.builtin.dict', components) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
- ansible.builtin.debug:
msg: chart_values | to_nice_yaml
- name: Parse helm charts for container images - name: Parse helm charts for container images
ansible.builtin.shell: ansible.builtin.shell:
cmd: "{{ item.value.helm.parse_logic }}" cmd: "{{ item.value.helm.parse_logic }}"