fix token management task to include regex_escape for special characters (#481)

Signed-off-by: Pete Pascente <ppascente@allete.com>
Co-authored-by: Pete Pascente <ppascente@allete.com>
This commit is contained in:
ppascente
2025-12-22 11:36:23 -06:00
committed by GitHub
parent 1dcc7a6267
commit e11ff62d8f
2 changed files with 2 additions and 2 deletions

View File

@@ -73,7 +73,7 @@
ansible.builtin.lineinfile:
state: absent
path: "{{ systemd_dir }}/k3s-agent.service.env"
regexp: "^K3S_TOKEN=\\s*(?!{{ token }}\\s*$)"
regexp: "^K3S_TOKEN=\\s*(?!{{ token | regex_escape }}\\s*$)"
- name: Add the token for joining the cluster to the environment
no_log: true # avoid logging the server token