Skip to content

Commit 9ead25f

Browse files
committed
Update lint on k3s_upgrade role to production level
Signed-off-by: Derek Nola <derek.nola@suse.com>
1 parent 1f3bc37 commit 9ead25f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

roles/k3s_upgrade/tasks/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
# local control-plane instead of the remote host. Shell supports wildcards.
44
- name: Get k3s installed version
55
ansible.builtin.command: k3s --version
6-
register: k3s_version_output
6+
register: k3s_upgrade_version_output
77
changed_when: false
88
check_mode: false
99

1010
- name: Set k3s installed version
1111
ansible.builtin.set_fact:
12-
installed_k3s_version: "{{ k3s_version_output.stdout_lines[0].split(' ')[2] }}"
12+
k3s_upgrade_current_version: "{{ k3s_upgrade_version_output.stdout_lines[0].split(' ')[2] }}"
1313
check_mode: false
1414

1515
# We should be downloading and installing the newer version only if we are in the following case :
1616
# - the installed version of K3s on the nodes is older than the requested version in ansible vars
1717
- name: Update node only if needed
18-
when: installed_k3s_version is version(k3s_version, '<')
18+
when: k3s_upgrade_current_version is version(k3s_version, '<')
1919
block:
2020
- name: Find K3s service files
21+
# noqa var-naming[no-role-prefix]
2122
ansible.builtin.find:
2223
paths: "{{ systemd_dir }}"
2324
patterns: "k3s*.service"

0 commit comments

Comments
 (0)