From f2dadb3e47b809e7dec88af54e653b0d1fb58fcf Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Tue, 17 Jan 2023 15:08:20 +0100 Subject: [PATCH] Move readycheck;Fix template value --- .../workloadcluster/tasks/clusterapi.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 99bc1d5..b612f1f 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 @@ -20,7 +20,7 @@ resourcepool: "{{ vcenter_info.resourcepool }}" folder: "{{ vcenter_info.folder }}" cluster: - nodetemplate: "{{ (components.clusterapi.workload.node_template.name | split('.'))[:-1] | join('.') }}" + nodetemplate: "{{ (components.clusterapi.workload.node_template.url | basename | split('.'))[:-1] | join('.') }}" publickey: "{{ vapp['guestinfo.rootsshkey'] }}" version: "{{ components.clusterapi.workload.version.k8s }}" vip: "{{ vapp['workloadcluster.vip'] }}" @@ -120,6 +120,17 @@ kubeconfig: "{{ kubeconfig.path }}" # TODO: move to git repo +- 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: Initialize tempfile ansible.builtin.tempfile: state: file @@ -140,17 +151,6 @@ 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 }}" - # TODO: move to git repo - name: Apply cni plugin manifest kubernetes.core.k8s: