2020-10-17 19:26:30 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check that all nodes to be ready
|
2021-04-10 13:15:51 +02:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "{{ k3s_install_dir }}/kubectl get nodes"
|
2020-10-17 19:26:30 +02:00
|
|
|
changed_when: false
|
2022-06-15 23:03:39 +02:00
|
|
|
failed_when: >-
|
|
|
|
kubectl_get_nodes_result.stdout.find("was refused") != -1 or
|
|
|
|
kubectl_get_nodes_result.stdout.find("ServiceUnavailable") != -1
|
2020-10-17 19:26:30 +02:00
|
|
|
register: kubectl_get_nodes_result
|
2021-02-16 16:46:01 +01:00
|
|
|
until:
|
|
|
|
- kubectl_get_nodes_result.rc == 0
|
|
|
|
- kubectl_get_nodes_result.stdout.find("NotReady") == -1
|
2020-10-17 19:26:30 +02:00
|
|
|
retries: 30
|
|
|
|
delay: 20
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
|
|
|
- k3s_control_node
|
|
|
|
- ("flannel-backend" not in k3s_runtime_config
|
|
|
|
or k3s_runtime_config["flannel-backend"] != "none")
|
|
|
|
- not ansible_check_mode
|
2022-01-02 22:52:09 +01:00
|
|
|
become: "{{ k3s_become }}"
|