mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
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:
@@ -73,7 +73,7 @@
|
|||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
state: absent
|
state: absent
|
||||||
path: "{{ systemd_dir }}/k3s-agent.service.env"
|
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
|
- name: Add the token for joining the cluster to the environment
|
||||||
no_log: true # avoid logging the server token
|
no_log: true # avoid logging the server token
|
||||||
|
|||||||
@@ -267,7 +267,7 @@
|
|||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
state: absent
|
state: absent
|
||||||
path: "{{ systemd_dir }}/k3s.service.env"
|
path: "{{ systemd_dir }}/k3s.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
|
- name: Add the token for joining the cluster to the environment
|
||||||
no_log: true # avoid logging the server token
|
no_log: true # avoid logging the server token
|
||||||
|
|||||||
Reference in New Issue
Block a user