- name: Install the worker nodes block: - name: Get the token set_fact: token: "{{ lookup('file',playbook_dir + '/config/token') }}" - name: Get the primary ip set_fact: primary_ip: "{{ lookup('file',playbook_dir + '/config/primary_ip') }}" - name: Run the installer shell: cmd: "curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='agent --server https://{{ primary_ip }}:6443 --token {{ token }}' sh -" args: creates: /var/lib/rancher/k3s/agent/k3scontroller.kubeconfig become: true when: "'workers' in group_names"