2022-03-26 22:05:57 +00:00
|
|
|
---
|
2022-06-25 14:19:15 +00:00
|
|
|
- name: get dependencies
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- apparmor
|
|
|
|
- apparmor-utils
|
|
|
|
|
2022-03-26 22:05:57 +00:00
|
|
|
- name: check k3s version
|
|
|
|
shell:
|
|
|
|
cmd: "k3s --version | grep k3s | cut -d' ' -f3"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
|
|
|
changed_when: False
|
|
|
|
register: installed_k3s_version
|
|
|
|
check_mode: False
|
|
|
|
|
|
|
|
- name: get k3s
|
|
|
|
get_url:
|
|
|
|
url: "https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s-arm64"
|
|
|
|
dest: /usr/local/bin/k3s
|
|
|
|
mode: 0755
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
when: installed_k3s_version.stdout != k3s_version
|
2022-06-25 14:19:15 +00:00
|
|
|
notify: restart k3s
|
2022-03-26 22:05:57 +00:00
|
|
|
|
|
|
|
- name: link k3s
|
|
|
|
file:
|
|
|
|
src: /usr/local/bin/k3s
|
|
|
|
dest: /usr/local/bin/kubernetes
|
|
|
|
state: link
|
2022-08-06 19:43:00 +00:00
|
|
|
|
|
|
|
- name: ensure k3s directory
|
|
|
|
file:
|
|
|
|
path: /etc/rancher/k3s
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: copy registries file
|
|
|
|
copy:
|
|
|
|
src: files/registries.yaml
|
|
|
|
dest: /etc/rancher/k3s/registries.yaml
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2022-03-26 22:05:57 +00:00
|
|
|
...
|