17 lines
805 B
YAML
17 lines
805 B
YAML
- 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') }}"
|
|
- debug:
|
|
msg: "curl -sfL https://get.k3s.io | K3S_URL=https://{{ primary_ip }}:6443 K3S_TOKEN={{ token }} sh -"
|
|
- name: Run the installer
|
|
shell:
|
|
cmd: "curl -sfL https://get.k3s.io | K3S_URL=https://{{ primary_ip }}:6443 K3S_TOKEN={{ token }} sh -"
|
|
args:
|
|
creates: /var/lib/rancher/k3s/agent/k3scontroller.kubeconfig
|
|
become: true
|
|
when: "'workers' in group_names" |