mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2026-06-24 12:07:21 +02:00
Fix existing token retrieval for k3s server (#534)
Signed-off-by: Jonathan Cremin <jonathan@crem.in>
This commit is contained in:
@@ -271,7 +271,7 @@
|
||||
when: token is not defined and hostvars[groups[server_group][0]].random_token is defined
|
||||
# noqa var-naming[no-role-prefix]
|
||||
ansible.builtin.set_fact:
|
||||
k3s_server_config: "{{ k3s_server_config | combine({'token': token}) }}"
|
||||
k3s_server_config: "{{ k3s_server_config | combine({'token': hostvars[groups[server_group][0]].random_token}) }}"
|
||||
|
||||
- name: Convert server config to YAML and write to file
|
||||
when: not ansible_check_mode
|
||||
@@ -285,7 +285,7 @@
|
||||
ansible.builtin.lineinfile:
|
||||
state: absent
|
||||
path: "{{ k3s_server_env_file }}"
|
||||
regexp: "^K3S_TOKEN=\\s*(?!{{ token | regex_escape }}\\s*$)"
|
||||
regexp: "^K3S_TOKEN=\\s*(?!{{ token | default('') | regex_escape }}\\s*$)"
|
||||
|
||||
- name: Reload systemd daemon
|
||||
when:
|
||||
|
||||
Reference in New Issue
Block a user