Own the k3s config.yaml in the kubernetes role template, write it only on a semantic change and run the installer only when the pinned k3s version differs

This commit is contained in:
2026-10-09 14:13:21 +00:00
parent 37e21ead36
commit 23ed82b113
7 changed files with 56 additions and 29 deletions
@@ -1,5 +1,8 @@
- name: Install K3s agent
command: /root/k3s_install.sh {{ type }}
environment:
INSTALL_K3S_VERSION: "{{ kubernetes.version }}"
when: k3s_installed.rc != 0 or (kubernetes.version != '' and ('k3s version ' ~ kubernetes.version ~ ' ') not in k3s_installed.stdout)
register: command
changed_when: "'No change detected' not in command.stdout"
until: "command is not failed"