用ansible安装containerd怎么写yaml
时间: 2023-03-15 20:19:40 浏览: 79
可以参考下面这段yaml示例:- name: 安装containerd
apt:
name: containerd
state: present
update_cache: yes
相关问题
ansible部署containerd的yaml
Ansible可以通过使用```docker_container```或```docker_service```模块来部署containerd。
下面是一个部署containerd的示例yaml文件:
```
- name: Deploy containerd
hosts: localhost
become: yes
tasks:
- name: Pull containerd image
docker_image:
name: containerd
tag: latest
- name: Create containerd container
docker_container:
name: containerd
image: containerd:latest
state: started
restart_policy: always
ports:
- "4222:4222"
- "2375:2375"
```
这个yaml文件会在localhost上运行, 拉取最新的containerd镜像并启动一个containerd容器, 并将容器端口4222和2375映射到主机上.
阅读全文