Test until-loop based on valid json being returned
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b50eecf441
commit
77a49b41a0
33
playbook.yml
33
playbook.yml
@ -137,23 +137,25 @@
|
||||
src: kube-vip.j2
|
||||
dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml
|
||||
|
||||
- name: Initial node -- Wait for available API
|
||||
ansible.builtin.shell:
|
||||
cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose"
|
||||
register: api_readycheck
|
||||
ignore_errors: yes
|
||||
until: "{{ ( api_readycheck.stdout | from_json ).apiVersion is defined }}"
|
||||
retries: 3
|
||||
delay: 30
|
||||
|
||||
delegate_to: "{{ ansible_play_hosts[0] }}"
|
||||
run_once: true
|
||||
|
||||
- block:
|
||||
|
||||
- ansible.builtin.shell:
|
||||
cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose"
|
||||
register: api_readycheck
|
||||
ignore_errors: yes
|
||||
- ansible.builtin.debug:
|
||||
var: api_readycheck.stdout
|
||||
|
||||
- name: Additional nodes -- Wait for available API
|
||||
ansible.builtin.wait_for:
|
||||
host: "{{ cluster.virtualip | ansible.utils.ipaddr('address') }}"
|
||||
port: 6443
|
||||
timeout: 300
|
||||
# - name: Additional nodes -- Wait for available API
|
||||
# ansible.builtin.wait_for:
|
||||
# host: "{{ cluster.virtualip | ansible.utils.ipaddr('address') }}"
|
||||
# port: 6443
|
||||
# timeout: 300
|
||||
|
||||
- name: Additional nodes -- Install K3s binary
|
||||
ansible.builtin.shell:
|
||||
@ -162,13 +164,6 @@
|
||||
K3S_TOKEN: "{{ cluster.token }}" # (hostvars[ansible_play_hosts[0]]).cluster.token
|
||||
K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}"
|
||||
|
||||
- ansible.builtin.shell:
|
||||
cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose"
|
||||
ignore_errors: yes
|
||||
register: api_readycheck
|
||||
- ansible.builtin.debug:
|
||||
var: api_readycheck.stdout
|
||||
|
||||
rescue:
|
||||
|
||||
- name: Debug systemd unit
|
||||
|
Loading…
Reference in New Issue
Block a user