aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/k8s/tasks/install_k3s_master.yml
blob: 71d880ef64eb609cfac0ac8b5f628c957c208edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
- name: Download k3s installer
  ansible.builtin.get_url:
    url: https://get.k3s.io
    dest: /tmp/install_k3s.sh
    mode: '0755'

- name: Install k3s server
  ansible.builtin.command: /tmp/install_k3s.sh server --cluster-init
  become: true

- name: Retrieve k3s token
  ansible.builtin.slurp:
    path: /var/lib/rancher/k3s/server/node-token
  register: k3s_token_file

- name: Set k3s token as a fact, for workers
  ansible.builtin.set_fact:
    k3s_token: "{{ k3s_token_file.content | b64decode }}"
...