Unverified Commit e11ff62d authored by ppascente's avatar ppascente Committed by GitHub
Browse files

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

parent 1dcc7a62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@
      ansible.builtin.lineinfile:
        state: absent
        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
      no_log: true # avoid logging the server token