diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml index c2f37b2..27880e7 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml @@ -117,6 +117,18 @@ content: "{{ capi_kubectl_config.stdout }}" mode: 0600 no_log: true + +- name: Wait for cluster to be available + ansible.builtin.shell: + cmd: >- + kubectl wait clusters.cluster.x-k8s.io/{{ vapp['workloadcluster.name'] | lower }} \ + --for=condition=Ready \ + --timeout 0s + register: cluster_readycheck + until: cluster_readycheck is succeeded + retries: "{{ playbook.retries }}" + delay: "{{ playbook.delays.long }}" + - name: Generate serviceaccount # TODO: move to GitOps kubernetes.core.k8s: diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/gitops.yml b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/gitops.yml new file mode 100644 index 0000000..043c65a --- /dev/null +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/gitops.yml @@ -0,0 +1 @@ +# - name: Register workload cluster in argo-cd diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/main.yml index a6937a4..b0f2266 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/main.yml @@ -1,4 +1,5 @@ - import_tasks: hypervisor.yml - import_tasks: registry.yml -- import_tasks: clusterapi.yml - import_tasks: nodetemplates.yml +- import_tasks: clusterapi.yml +- import_tasks: gitops.yml