diff --git a/playbook.yml b/playbook.yml index 9df362b..450d739 100644 --- a/playbook.yml +++ b/playbook.yml @@ -137,20 +137,14 @@ src: kube-vip.j2 dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml - - block: - - - name: Initial node -- Test API - ansible.builtin.shell: - cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose" - register: api_readycheck - ignore_errors: yes - - - name: Initial node -- Check for valid output - ansible.builtin.set_fact: - api_validoutput: "{{ ( api_readycheck.stdout | from_json ) }}" - ignore_errors: yes - - until: api_validoutput.apiVersion is defined + - name: Initial node -- Wait for available API + ansible.netcommon.cli_parse: + command: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose" + parser: + name: ansible.utils.json + register: api_readycheck + ignore_errors: yes + until: api_readycheck.apiVersion is defined retries: 3 delay: 30