2022-11-04 20:58:37 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check that all nodes to be ready
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "{{ k3s_install_dir }}/kubectl get nodes"
|
|
|
|
changed_when: false
|
|
|
|
failed_when: >-
|
|
|
|
kubectl_get_nodes_result.stdout.find("was refused") != -1 or
|
|
|
|
kubectl_get_nodes_result.stdout.find("ServiceUnavailable") != -1
|
|
|
|
register: kubectl_get_nodes_result
|
|
|
|
until:
|
|
|
|
- kubectl_get_nodes_result.rc == 0
|
|
|
|
- kubectl_get_nodes_result.stdout.find("NotReady") == -1
|
|
|
|
retries: 30
|
2023-02-17 12:00:24 +01:00
|
|
|
delay: 5
|
2022-11-04 20:58:37 +01:00
|
|
|
when:
|
|
|
|
- k3s_control_node
|
|
|
|
- ("flannel-backend" not in k3s_runtime_config
|
|
|
|
or k3s_runtime_config["flannel-backend"] != "none")
|
|
|
|
- not ansible_check_mode
|
|
|
|
become: "{{ k3s_become }}"
|