- hosts: odroid_worker
  name: Another task
  become: true
  tasks:
    - name: Print token
      ansible.builtin.debug:
        msg: "[Master] K3S_TOKEN_HOLDER K3S token is {{ hostvars['K3S_TOKEN_HOLDER']['token'] }}"
    - name: Print token
      ansible.builtin.debug:
        msg: "{{ hostvars['K3S_TOKEN_HOLDER']['token'] }}"
    - name: Reconfigure K3S Worker
      ansible.builtin.lineinfile:
        path: /etc/systemd/system/k3s-agent.service.env
        regexp: '^K3S_TOKEN='
        line: K3S_TOKEN=\'{{ hostvars['K3S_TOKEN_HOLDER']['token'] }}\'
      changed_when: false
    - name: Restart K3S Worker
      ansible.builtin.service:
        name: k3s-agent
        state: restarted
