fix(k3s_server): skip installation if k3s binary already exists

Primary and secondary install tasks now check k3s_status.stat.exists
so re-running the playbook is idempotent on already-provisioned nodes.
This commit is contained in:
Tuan-Dat Tran
2026-04-27 21:43:42 +02:00
parent b4e093c9b1
commit 8da0ab98f8

View File

@@ -16,14 +16,18 @@
- name: Install primary k3s server
include_tasks: primary_installation.yaml
when: inventory_hostname == groups['k3s_server'] | first
when:
- inventory_hostname == groups['k3s_server'] | first
- not k3s_status.stat.exists
- name: Get token from primary k3s server
include_tasks: pull_token.yaml
- name: Install seconary k3s servers
include_tasks: secondary_installation.yaml
when: inventory_hostname != groups['k3s_server'] | first
when:
- inventory_hostname != groups['k3s_server'] | first
- not k3s_status.stat.exists
- name: Set kubeconfig on localhost
include_tasks: create_kubeconfig.yaml