containers.podman.podman_containers 模块 – 批量管理 podman 容器
注意
此模块是 containers.podman 集合(版本 1.16.2)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install containers.podman。您需要满足其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:containers.podman.podman_containers。
containers.podman 1.4.0 中的新增功能
概要
- 管理 podman 容器组 
要求
执行此模块的主机上需要满足以下要求。
- podman 
参数
| 参数 | 注释 | 
|---|---|
| 包含用于运行 podman_container 模块的容器数据的字典列表。 | |
| 返回有助于调查的附加信息。 选项 
 | 
示例
- name: Run three containers at once
  podman_containers:
    containers:
      - name: alpine
        image: alpine
        command: sleep 1d
      - name: web
        image: nginx
      - name: test
        image: python:3.10-alpine
        command: python -V
