diff --git a/ansible/roles/assets/tasks/containerimages.yml b/ansible/roles/assets/tasks/containerimages.yml index d09f7de..664fce9 100644 --- a/ansible/roles/assets/tasks/containerimages.yml +++ b/ansible/roles/assets/tasks/containerimages.yml @@ -20,7 +20,7 @@ chdir: /opt/metacluster/helm-charts/{{ item.key }} register: chartimages_metacluster when: item.value.helm is defined - loop: "{{ lookup('ansible.builtin.dict', components) }}" + loop: "{{ query('ansible.builtin.dict', components) }}" loop_control: label: "{{ item.key }}" @@ -29,7 +29,7 @@ cmd: "{{ item.value.parse_logic }}" chdir: /opt/workloadcluster/helm-charts/{{ item.value.namespace }}/{{ item.key }} register: chartimages_workloadcluster - loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}" + loop: "{{ query('ansible.builtin.dict', downstream.helm_charts) }}" loop_control: label: "{{ item.key }}" diff --git a/ansible/roles/assets/tasks/helm.yml b/ansible/roles/assets/tasks/helm.yml index 03071c6..8e82710 100644 --- a/ansible/roles/assets/tasks/helm.yml +++ b/ansible/roles/assets/tasks/helm.yml @@ -11,7 +11,7 @@ chdir: /opt/metacluster/helm-charts when: item.value.helm is defined register: helmcharts_metacluster - loop: "{{ lookup('ansible.builtin.dict', components) }}" + loop: "{{ query('ansible.builtin.dict', components) }}" loop_control: label: "{{ item.key }}" retries: 5 @@ -23,7 +23,7 @@ cmd: helm fetch {{ item.value.chart }} --untardir ./{{ item.value.namespace }} --untar --version {{ item.value.version }} chdir: /opt/workloadcluster/helm-charts register: helmcharts_workloadcluster - loop: "{{ lookup('ansible.builtin.dict', downstream.helm_charts) }}" + loop: "{{ query('ansible.builtin.dict', downstream.helm_charts) }}" loop_control: label: "{{ item.key }}" retries: 5 diff --git a/ansible/roles/assets/tasks/manifests.yml b/ansible/roles/assets/tasks/manifests.yml index 29e13e2..5a89f82 100644 --- a/ansible/roles/assets/tasks/manifests.yml +++ b/ansible/roles/assets/tasks/manifests.yml @@ -4,7 +4,7 @@ ansible.builtin.set_fact: 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 - loop: "{{ lookup('ansible.builtin.dict', components) }}" + loop: "{{ query('ansible.builtin.dict', components) }}" loop_control: label: "{{ item.key }}" @@ -24,7 +24,7 @@ ansible.builtin.set_fact: workloadcluster_chartvalues: "{{ workloadcluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.chart_values | from_yaml) } }) }}" 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: label: "{{ item.key }}" @@ -104,6 +104,6 @@ # owner: root # group: root # 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: # label: "{{ item.type ~ '/' ~ item.name }}" diff --git a/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/gitops.yml b/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/gitops.yml index f57e181..bc6f7e5 100644 --- a/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/gitops.yml +++ b/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/gitops.yml @@ -17,7 +17,7 @@ ansible.builtin.file: path: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }} state: directory - loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}" + loop: "{{ query('ansible.builtin.dict', downstream_components) }}" loop_control: label: "{{ item.key }}" @@ -25,7 +25,7 @@ ansible.builtin.copy: dest: /opt/workloadcluster/git-repositories/gitops/values/{{ item.key }}/values.yaml content: "{{ item.value.chart_values | default('# Empty') }}" - loop: "{{ lookup('ansible.builtin.dict', downstream_components) }}" + loop: "{{ query('ansible.builtin.dict', downstream_components) }}" loop_control: label: "{{ item.key }}" diff --git a/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 b/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 index c0aeb3e..c9c1c18 100644 --- a/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 +++ b/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 @@ -219,3 +219,12 @@ patchesJson6902: - op: replace path: /spec/machineTemplate/infrastructureRef/name 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 diff --git a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/decommission/tasks/storage.yml b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/decommission/tasks/storage.yml index ab3d9c9..a675b83 100644 --- a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/decommission/tasks/storage.yml +++ b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/decommission/tasks/storage.yml @@ -22,6 +22,6 @@ spec: numberOfReplicas: {{ (lookup('kubernetes.core.k8s', kind='node', kubeconfig=(kubeconfig.path)) | length | int) - 1 }} 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: label: "{{ item.metadata.name }}" diff --git a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml index 280a6ae..282d8a4 100644 --- a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml +++ b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml @@ -11,7 +11,7 @@ spec: numberOfReplicas: {{ lookup('kubernetes.core.k8s', kind='node', kubeconfig=(kubeconfig.path)) | length | int }} 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: label: "{{ item.metadata.name }}"