File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments