ansible-role-k3s/tasks/validate/check-cluster-nodes-ready.yml

18 lines
743 B
YAML
Raw Normal View History

2020-10-17 19:26:30 +02:00
---
- name: Check that all nodes to be ready
command: "{{ 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
and kubectl_get_nodes_result.stdout.find("NotReady") == -1
retries: 30
delay: 20
2020-10-19 21:26:12 +02:00
when: k3s_control_node
and (("disable" not in k3s_runtime_config)
or ("disable" in k3s_runtime_config and "flannel" not in k3s_runtime_config.disable))
2020-10-19 21:26:12 +02:00
and not ansible_check_mode
2020-10-17 19:26:30 +02:00
become: "{{ k3s_become_for_kubectl | ternary(true, false, k3s_become_for_all) }}"