forked from tim/k3s-ansible
fix(token): escape percent signs used in k3s token (#682)
- systemd treats % as a specifier in ExecStart, so token values containing % fail with 'failed to resolve unit specifiers invalid slot' - escape % to %% in the agent unit file - escape % to %% in server_init_args so the multi-master bootstrap path (systemd-run k3s-init) handles % tokens too Co-authored-by: finaldoom <677609+FinalDoom@users.noreply.github.com>
This commit is contained in:
@@ -11,7 +11,7 @@ ExecStartPre=-/sbin/modprobe overlay
|
||||
ExecStart=/usr/local/bin/k3s agent \
|
||||
--server https://{{ apiserver_endpoint | ansible.utils.ipwrap }}:6443 \
|
||||
{% if is_pxe_booted | default(false) %}--snapshotter native \
|
||||
{% endif %}--token {{ hostvars[groups[group_name_master | default('master')][0]]['token'] | default(k3s_token) }} \
|
||||
{% endif %}--token {{ hostvars[groups[group_name_master | default('master')][0]]['token'] | default(k3s_token) | replace( '%', '%%' ) }} \
|
||||
{{ extra_agent_args }}
|
||||
KillMode=process
|
||||
Delegate=yes
|
||||
|
||||
Reference in New Issue
Block a user