fix: Aggregate dictionary content within respective component task list
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2023-07-18 16:05:54 +02:00
parent 8005b172a5
commit 36c30ca646
2 changed files with 23 additions and 25 deletions

View File

@ -1,4 +1,25 @@
- block: - block:
- name: Aggregate manifest-component versions into dictionary
ansible.builtin.set_fact:
manifest_versions: "{{ manifest_versions | default([]) + [ item | combine( {'type': 'manifest', 'id': index } ) ] }}"
loop:
- name: cluster-api
versions:
management:
base: "{{ components.clusterapi.management.version.base }}"
cert_manager: "{{ components.clusterapi.management.version.cert_manager }}"
infrastructure_vsphere: "{{ components.clusterapi.management.version.infrastructure_vsphere }}"
ipam_incluster: "{{ components.clusterapi.management.version.ipam_incluster }}"
cpi_vsphere: "{{ components.clusterapi.management.version.cpi_vsphere }}"
workload:
calico: "{{ components.clusterapi.workload.version.calico }}"
k8s: "{{ components.clusterapi.workload.version.k8s }}"
- name: kube-vip
version: "{{ components.kubevip.version }}"
loop_control:
label: "{{ item.name }}"
index_var: index
- name: Install json-server chart - name: Install json-server chart
kubernetes.core.helm: kubernetes.core.helm:
name: json-server name: json-server
@ -13,7 +34,7 @@
combine( { combine( {
'jsonServer': { 'jsonServer': {
'seedData': { 'seedData': {
'configInline': ( components['json-server'].chart_values.jsonServer.seedData.configInline | to_json ) 'configInline': (components['json-server'].chart_values.jsonServer.seedData.configInline | combine( { 'components': manifest_versions } ) | to_json)
} }
} }
} ) } )

View File

@ -193,30 +193,7 @@ components:
configInline: | configInline: |
{ {
"appliance": { "version": "{{ appliance.version }}" }, "appliance": { "version": "{{ appliance.version }}" },
"components": [ "components": [],
{ "id": 0,
"name": "cluster-api",
"type": "manifest",
"versions": {
"management": {
"base": "{{ components.clusterapi.management.version.base }}",
"cert_manager": "{{ components.clusterapi.management.version.cert_manager }}",
"infrastructure_vsphere": "{{ components.clusterapi.management.version.infrastructure_vsphere }}",
"ipam_incluster": "{{ components.clusterapi.management.version.ipam_incluster }}",
"cpi_vsphere": "{{ components.clusterapi.management.version.cpi_vsphere }}"
},
"workload": {
"calico": "{{ components.clusterapi.workload.version.calico }}",
"k8s": "{{ components.clusterapi.workload.version.k8s }}"
}
}
},
{ "id": 1,
"name": "kube-vip",
"type": "manifest",
"version": "{{ components.kubevip.version }}"
}
],
"healthz": { "status": "running" } "healthz": { "status": "running" }
} }
sidecar: sidecar: