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