Add missing kustomize patch;Switch to query filter
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2023-04-05 13:37:31 +02:00
parent 2b56677e9a
commit db090ac564
7 changed files with 20 additions and 11 deletions

View File

@ -20,7 +20,7 @@
chdir: /opt/metacluster/helm-charts/{{ item.key }} chdir: /opt/metacluster/helm-charts/{{ item.key }}
register: chartimages_metacluster register: chartimages_metacluster
when: item.value.helm is defined when: item.value.helm is defined
loop: "{{ lookup('ansible.builtin.dict', components) }}" loop: "{{ query('ansible.builtin.dict', components) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
@ -29,7 +29,7 @@
cmd: "{{ item.value.parse_logic }}" cmd: "{{ item.value.parse_logic }}"
chdir: /opt/workloadcluster/helm-charts/{{ item.value.namespace }}/{{ item.key }} chdir: /opt/workloadcluster/helm-charts/{{ item.value.namespace }}/{{ item.key }}
register: chartimages_workloadcluster register: chartimages_workloadcluster
loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}" loop: "{{ query('ansible.builtin.dict', downstream.helm_charts) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"

View File

@ -11,7 +11,7 @@
chdir: /opt/metacluster/helm-charts chdir: /opt/metacluster/helm-charts
when: item.value.helm is defined when: item.value.helm is defined
register: helmcharts_metacluster register: helmcharts_metacluster
loop: "{{ lookup('ansible.builtin.dict', components) }}" loop: "{{ query('ansible.builtin.dict', components) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
retries: 5 retries: 5
@ -23,7 +23,7 @@
cmd: helm fetch {{ item.value.chart }} --untardir ./{{ item.value.namespace }} --untar --version {{ item.value.version }} cmd: helm fetch {{ item.value.chart }} --untardir ./{{ item.value.namespace }} --untar --version {{ item.value.version }}
chdir: /opt/workloadcluster/helm-charts chdir: /opt/workloadcluster/helm-charts
register: helmcharts_workloadcluster register: helmcharts_workloadcluster
loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}" loop: "{{ query('ansible.builtin.dict', downstream.helm_charts) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
retries: 5 retries: 5

View File

@ -4,7 +4,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
metacluster_chartvalues: "{{ metacluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.helm.chart_values | from_yaml) } }) }}" metacluster_chartvalues: "{{ metacluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.helm.chart_values | from_yaml) } }) }}"
when: item.value.helm.chart_values is defined when: item.value.helm.chart_values is defined
loop: "{{ lookup('ansible.builtin.dict', components) }}" loop: "{{ query('ansible.builtin.dict', components) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
@ -24,7 +24,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
workloadcluster_chartvalues: "{{ workloadcluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.chart_values | from_yaml) } }) }}" workloadcluster_chartvalues: "{{ workloadcluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.chart_values | from_yaml) } }) }}"
when: item.value.chart_values is defined when: item.value.chart_values is defined
loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}" loop: "{{ query('ansible.builtin.dict', downstream.helm_charts) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
@ -104,6 +104,6 @@
# owner: root # owner: root
# group: root # group: root
# mode: 0600 # mode: 0600
# loop: "{{ lookup('ansible.builtin.dict', components) | map(attribute='value.manifests') | list | select('defined') | flatten }}" # loop: "{{ query('ansible.builtin.dict', components) | map(attribute='value.manifests') | list | select('defined') | flatten }}"
# loop_control: # loop_control:
# label: "{{ item.type ~ '/' ~ item.name }}" # label: "{{ item.type ~ '/' ~ item.name }}"

View File

@ -17,7 +17,7 @@
ansible.builtin.file: ansible.builtin.file:
path: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }} path: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}
state: directory state: directory
loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}" loop: "{{ query('ansible.builtin.dict', downstream_components) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
@ -25,7 +25,7 @@
ansible.builtin.copy: ansible.builtin.copy:
dest: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}/values.yaml dest: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}/values.yaml
content: "{{ item.value.chart_values | default('# Empty') }}" content: "{{ item.value.chart_values | default('# Empty') }}"
loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}" loop: "{{ query('ansible.builtin.dict', downstream_components) }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"

View File

@ -219,3 +219,12 @@ patchesJson6902:
- op: replace - op: replace
path: /spec/machineTemplate/infrastructureRef/name path: /spec/machineTemplate/infrastructureRef/name
value: ${CLUSTER_NAME}-master value: ${CLUSTER_NAME}-master
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /spec/controlPlaneRef/name
value: ${CLUSTER_NAME}-master

View File

@ -22,6 +22,6 @@
spec: spec:
numberOfReplicas: {{ (lookup('kubernetes.core.k8s', kind='node', kubeconfig=(kubeconfig.path)) | length | int) - 1 }} numberOfReplicas: {{ (lookup('kubernetes.core.k8s', kind='node', kubeconfig=(kubeconfig.path)) | length | int) - 1 }}
kubeconfig: "{{ kubeconfig.path }}" kubeconfig: "{{ kubeconfig.path }}"
loop: "{{ lookup('kubernetes.core.k8s', api_version='longhorn.io/v1beta2', kind='volume', namespace='longhorn-system', kubeconfig=(kubeconfig.path)) }}" loop: "{{ query('kubernetes.core.k8s', api_version='longhorn.io/v1beta2', kind='volume', namespace='longhorn-system', kubeconfig=(kubeconfig.path)) }}"
loop_control: loop_control:
label: "{{ item.metadata.name }}" label: "{{ item.metadata.name }}"

View File

@ -11,7 +11,7 @@
spec: spec:
numberOfReplicas: {{ lookup('kubernetes.core.k8s', kind='node', kubeconfig=(kubeconfig.path)) | length | int }} numberOfReplicas: {{ lookup('kubernetes.core.k8s', kind='node', kubeconfig=(kubeconfig.path)) | length | int }}
kubeconfig: "{{ kubeconfig.path }}" kubeconfig: "{{ kubeconfig.path }}"
loop: "{{ lookup('kubernetes.core.k8s', api_version='longhorn.io/v1beta2', kind='volume', namespace='longhorn-system', kubeconfig=(kubeconfig.path)) }}" loop: "{{ query('kubernetes.core.k8s', api_version='longhorn.io/v1beta2', kind='volume', namespace='longhorn-system', kubeconfig=(kubeconfig.path)) }}"
loop_control: loop_control:
label: "{{ item.metadata.name }}" label: "{{ item.metadata.name }}"