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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user