fix(start): annoying behaviour where k3s won't start as a single node in ha etcd #152

This commit is contained in:
Xan Manning 2021-12-20 21:06:10 +00:00 committed by Curtis John
parent e457854046
commit 0fa1ef29a9

View file

@ -17,6 +17,11 @@
- include_tasks: install-k3s-node.yml
when: k3s_build_cluster
- name: Determine if the systems are already clustered
ansible.builtin.stat:
path: "{{ k3s_token_location }}"
register: k3s_token_cluster_check
- name: Ensure k3s initial control plane server is started
ansible.builtin.systemd:
name: k3s
@ -29,4 +34,5 @@
- not ansible_check_mode
when: (k3s_control_node and k3s_controller_list | length == 1)
or (k3s_primary_control_node and k3s_controller_list | length > 1)
or k3s_token_cluster_check.stat.exists
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"