refactor: replace docker stack with k3s/containerd
This commit is contained in:
18
ansible/roles/k3s/tasks/containerd.yml
Normal file
18
ansible/roles/k3s/tasks/containerd.yml
Normal file
@ -0,0 +1,18 @@
|
||||
- name: Add apt key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
|
||||
- name: Add docker-ce repository
|
||||
apt_repository:
|
||||
repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
|
||||
state: present
|
||||
filename: 'docker'
|
||||
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: Install containerd.io
|
||||
apt:
|
||||
name:
|
||||
- containerd.io
|
||||
state: present
|
20
ansible/roles/k3s/tasks/k3s.yml
Normal file
20
ansible/roles/k3s/tasks/k3s.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Download k3s binary
|
||||
get_url:
|
||||
url: "{{ k3s_url}}"
|
||||
dest: "/usr/local/bin/k3s"
|
||||
mode: 0755
|
||||
force: yes
|
||||
|
||||
- name: Copy systemd script
|
||||
template:
|
||||
src: k3s.service.j2
|
||||
dest: /etc/systemd/system/k3s.service
|
||||
notify: restart k3s
|
||||
|
||||
- name: Ensure k3s service is started
|
||||
systemd:
|
||||
name: k3s
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
state: started
|
3
ansible/roles/k3s/tasks/main.yaml
Normal file
3
ansible/roles/k3s/tasks/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
- include_tasks: containerd.yml
|
||||
- include_tasks: k3s.yml
|
Reference in New Issue
Block a user