Skip to content

Commit 1f3bc37

Browse files
committed
Fix linting to bring back 'production' status for k3s_agent role
Signed-off-by: Derek Nola <derek.nola@suse.com>
1 parent 8ab3706 commit 1f3bc37

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

roles/k3s_agent/tasks/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
- name: Get k3s installed version
33
ansible.builtin.command: k3s --version
4-
register: k3s_version_output
4+
register: k3s_agent_version_output
55
changed_when: false
66
ignore_errors: true
77

88
- name: Set k3s installed version
9-
when: not ansible_check_mode and k3s_version_output.rc == 0
9+
when: not ansible_check_mode and k3s_agent_version_output.rc == 0
1010
ansible.builtin.set_fact:
11-
installed_k3s_version: "{{ k3s_version_output.stdout_lines[0].split(' ')[2] }}"
11+
k3s_agent_installed_version: "{{ k3s_agent_version_output.stdout_lines[0].split(' ')[2] }}"
1212

1313
# If airgapped, all K3s artifacts are already on the node.
1414
# We should be downloading and installing the newer version only if we are in one of the following cases :
1515
# - we couldn't get k3s installed version in the first task of this role
1616
# - the installed version of K3s on the nodes is older than the requested version in ansible vars
1717
- name: Download artifact only if needed
18-
when: not ansible_check_mode and airgap_dir is undefined and ( k3s_version_output.rc != 0 or installed_k3s_version is version(k3s_version, '<') )
18+
when: not ansible_check_mode and airgap_dir is undefined and ( k3s_agent_version_output.rc != 0 or k3s_agent_installed_version is version(k3s_version, '<') )
1919
block:
2020
- name: Download K3s install script
2121
ansible.builtin.get_url:
@@ -50,13 +50,15 @@
5050
mode: "0755"
5151
state: directory
5252
- name: Copy config values
53+
# noqa var-naming[no-role-prefix]
5354
ansible.builtin.copy:
5455
content: "{{ agent_config_yaml }}"
5556
dest: "/etc/rancher/k3s/config.yaml"
5657
mode: "0644"
5758
register: _agent_config_result
5859

5960
- name: Get the token from the first server
61+
# noqa var-naming[no-role-prefix]
6062
ansible.builtin.set_fact:
6163
token: "{{ hostvars[groups[server_group][0]].token }}"
6264

0 commit comments

Comments
 (0)