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
|
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
|
||||||
|
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] }}"
|
delegate_to: "{{ ansible_play_hosts[0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
|
||||||
- ansible.builtin.shell:
|
# - name: Additional nodes -- Wait for available API
|
||||||
cmd: "curl -k https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443/livez?verbose"
|
# ansible.builtin.wait_for:
|
||||||
register: api_readycheck
|
# host: "{{ cluster.virtualip | ansible.utils.ipaddr('address') }}"
|
||||||
ignore_errors: yes
|
# port: 6443
|
||||||
- ansible.builtin.debug:
|
# timeout: 300
|
||||||
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 -- Install K3s binary
|
- name: Additional nodes -- Install K3s binary
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
@ -162,13 +164,6 @@
|
|||||||
K3S_TOKEN: "{{ cluster.token }}" # (hostvars[ansible_play_hosts[0]]).cluster.token
|
K3S_TOKEN: "{{ cluster.token }}" # (hostvars[ansible_play_hosts[0]]).cluster.token
|
||||||
K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}"
|
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:
|
rescue:
|
||||||
|
|
||||||
- name: Debug systemd unit
|
- name: Debug systemd unit
|
||||||
|
Loading…
Reference in New Issue
Block a user