Escape regex special characters in token value (#391)

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/392/head
Derek Nola 2025-02-13 09:07:24 -08:00 committed by GitHub
parent 978bc50b3e
commit 2c3bc06537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@
ansible.builtin.lineinfile:
state: absent
path: "{{ systemd_dir }}/k3s.service.env"
regexp: "^K3S_TOKEN=\\s*(?!{{ token | default('') }}\\s*$)"
regexp: "^K3S_TOKEN=\\s*(?!{{ token | default('') | regex_escape }}\\s*$)"
# Add the token to the environment if it has been provided.
# Otherwise, let the first server create one on the first run.