Fix linting to bring back 'production' status for all non-server k3s roles

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola
2025-09-15 12:09:45 -07:00
parent d397c5c3dd
commit b77e0049c8
5 changed files with 63 additions and 64 deletions

View File

@@ -3,21 +3,22 @@
# local control-plane instead of the remote host. Shell supports wildcards.
- name: Get k3s installed version
ansible.builtin.command: k3s --version
register: k3s_version_output
register: k3s_upgrade_version_output
changed_when: false
check_mode: false
- name: Set k3s installed version
ansible.builtin.set_fact:
installed_k3s_version: "{{ k3s_version_output.stdout_lines[0].split(' ')[2] }}"
k3s_upgrade_current_version: "{{ k3s_upgrade_version_output.stdout_lines[0].split(' ')[2] }}"
check_mode: false
# We should be downloading and installing the newer version only if we are in the following case :
# - the installed version of K3s on the nodes is older than the requested version in ansible vars
- name: Update node only if needed
when: installed_k3s_version is version(k3s_version, '<')
when: k3s_upgrade_current_version is version(k3s_version, '<')
block:
- name: Find K3s service files
# noqa var-naming[no-role-prefix]
ansible.builtin.find:
paths: "{{ systemd_dir }}"
patterns: "k3s*.service"