infra/ansible/roles/k3s/tasks/server.yml

32 lines
645 B
YAML

---
- name: get k3s token
slurp:
src: /var/lib/rancher/k3s/server/node-token
register: registered_k3s_node_token
- name: set k3s token var
set_fact:
k3s_node_token: "{{ registered_k3s_node_token.content | b64decode | trim }}"
- name: set kubectl symlink
file:
state: link
src: /usr/local/bin/k3s
dest: /usr/local/bin/kubectl
- name: template k3s server systemd
template:
src: templates/k3s.service.j2
dest: /etc/systemd/system/k3s.service
owner: root
group: root
mode: 0644
- name: enable and start k3s
systemd:
daemon_reload: yes
enabled: yes
name: k3s
state: started
...