fix: change directory for containerd binaries

v3.3
gjmzj 2023-04-02 07:38:27 +08:00
parent 8973480eab
commit 54bae288ba
2 changed files with 9 additions and 12 deletions

View File

@ -6,24 +6,21 @@
- name: 准备containerd相关目录
file: name={{ item }} state=directory
with_items:
- "{{ bin_dir }}"
- "{{ bin_dir }}/containerd-bin"
- "/etc/containerd"
- name: 加载内核模块 overlay
modprobe: name=overlay state=present
- name: 下载 containerd 二进制文件
copy: src={{ base_dir }}/bin/containerd-bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
- containerd
- containerd-shim
- containerd-shim-runc-v1
- containerd-shim-runc-v2
- crictl
- ctr
- runc
copy: src={{ item }} dest={{ bin_dir }}/containerd-bin/ mode=0755
with_fileglob:
- {{ base_dir }}/bin/containerd-bin/*
tags: upgrade
- name: 下载 crictl
copy: src={{ base_dir }}/bin/crictl dest={{ bin_dir }}/crictl mode=0755
- name: 添加 crictl 自动补全
lineinfile:
dest: ~/.bashrc

View File

@ -4,9 +4,9 @@ Documentation=https://containerd.io
After=network.target
[Service]
Environment="PATH={{ bin_dir }}:/bin:/sbin:/usr/bin:/usr/sbin"
Environment="PATH={{ bin_dir }}/containerd-bin:/bin:/sbin:/usr/bin:/usr/sbin"
ExecStartPre=-/sbin/modprobe overlay
ExecStart={{ bin_dir }}/containerd
ExecStart={{ bin_dir }}/containerd-bin/containerd
Restart=always
RestartSec=5
Delegate=yes