Fix getting random token for agents

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola
2026-02-27 14:34:29 -08:00
parent 3da1bcc10c
commit aec5f0297c

View File

@@ -65,9 +65,10 @@
register: _agent_config_result register: _agent_config_result
- name: Get the token from the first server - name: Get the token from the first server
when: token is not defined and hostvars[groups[server_group][0]].random_token is defined
# noqa var-naming[no-role-prefix] # noqa var-naming[no-role-prefix]
ansible.builtin.set_fact: ansible.builtin.set_fact:
token: "{{ hostvars[groups[server_group][0]].token }}" token: "{{ hostvars[groups[server_group][0]].random_token }}"
- name: Set k3s agent environment file based on init system - name: Set k3s agent environment file based on init system
ansible.builtin.set_fact: ansible.builtin.set_fact: