Compare commits

..

2 Commits

Author SHA1 Message Date
8d1f9f4944 fix: add k3s reset logic for primary control plane
Some checks failed
Deploy Cluster / Terraform (push) Successful in 39s
Deploy Cluster / Ansible (push) Failing after 4m19s
2026-03-21 16:10:17 +00:00
d4fd43e2f5 refactor: simplify k3s-server bootstrap for 2026-03-21 15:48:33 +00:00

View File

@@ -28,27 +28,22 @@
stat: stat:
path: /usr/local/bin/k3s-uninstall.sh path: /usr/local/bin/k3s-uninstall.sh
register: k3s_uninstall_script register: k3s_uninstall_script
when: when: k3s_install_needed
- not (k3s_primary | default(false))
- k3s_install_needed
- name: Reset broken secondary k3s install before rejoin - name: Reset broken k3s install before reinstall
command: /usr/local/bin/k3s-uninstall.sh command: /usr/local/bin/k3s-uninstall.sh
when: when:
- not (k3s_primary | default(false))
- k3s_install_needed - k3s_install_needed
- k3s_uninstall_script.stat.exists - k3s_uninstall_script.stat.exists
- name: Remove stale k3s data on secondary - name: Remove stale k3s data
file: file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
loop: loop:
- /etc/rancher/k3s - /etc/rancher/k3s
- /var/lib/rancher/k3s - /var/lib/rancher/k3s
when: when: k3s_install_needed
- not (k3s_primary | default(false))
- k3s_install_needed
- name: Download k3s install script - name: Download k3s install script
get_url: get_url: