Split up tasks (avoid jinja templating in conditionals)
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-04-22 18:07:50 +02:00
parent 77a49b41a0
commit 991882a7b1

View File

@ -137,12 +137,20 @@
src: kube-vip.j2 src: kube-vip.j2
dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml
- name: Initial node -- Wait for available API - block:
ansible.builtin.shell:
cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose" - name: Initial node -- Test API
register: api_readycheck ansible.builtin.shell:
ignore_errors: yes cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose"
until: "{{ ( api_readycheck.stdout | from_json ).apiVersion is defined }}" 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
retries: 3 retries: 3
delay: 30 delay: 30