mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 10:13:58 +00:00
35 lines
1.1 KiB
YAML
35 lines
1.1 KiB
YAML
---
|
|
- name: Reset k3s nodes and reinstall with vault token
|
|
hosts: k3s_hosts
|
|
become: true
|
|
serial: 1
|
|
vars:
|
|
# During a reset we want to proactively remove the node object from the cluster
|
|
# (via a healthy control-plane host) before shutting down local k3s services.
|
|
# This prevents stale `NotReady` nodes, DaemonSet pods stuck `Terminating`, and
|
|
# `kube-node-lease` entries that can cause future joins/reinstalls to hang.
|
|
k3s_reset_force_cluster_node_delete: true
|
|
tasks:
|
|
- name: Ensure cgroup kernel params are set
|
|
ansible.builtin.import_role:
|
|
name: cgroups
|
|
|
|
- name: Remove existing k3s installation and data
|
|
ansible.builtin.import_role:
|
|
name: k3s
|
|
tasks_from: cleanup
|
|
|
|
- name: Reinstall and configure k3s
|
|
ansible.builtin.import_role:
|
|
name: k3s
|
|
|
|
- name: Refresh kubeconfig on controller after reset
|
|
hosts: k3s_hosts
|
|
gather_facts: false
|
|
run_once: true
|
|
tasks:
|
|
- name: Fetch and save kubeconfig on controller
|
|
ansible.builtin.import_role:
|
|
name: k3s
|
|
tasks_from: fetch_kubeconfig
|