containers.podman.podman_import 模块 – 从 tar 文件导入 Podman 容器。
注意
此模块是 containers.podman 集合(版本 1.16.2)的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install containers.podman
。您需要满足其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在剧本中使用它,请指定:containers.podman.podman_import
。
概要
podman import 导入一个 tar 包(.tar、.tar.gz、.tgz、.bzip、.tar.xz、.txz),并将其保存为文件系统镜像。
要求
在执行此模块的主机上需要以下要求。
主机上已安装 Podman
参数
参数 |
注释 |
---|---|
将更改设置为键值对的列表,请参阅示例。 |
|
为导入的镜像设置提交消息 |
|
如果 默认值: |
|
要加载的镜像文件的路径。 |
|
要导入的卷,不能与 change 和 commit_message 一起使用 |
示例
# What modules does for example
- containers.podman.podman_import:
src: /path/to/tar/file
change:
- "CMD": /bin/bash
- "User": root
commit_message: "Importing image"
- containers.podman.podman_import:
src: /path/to/tar/file
volume: myvolume
返回值
常见的返回值记录在这里,以下是此模块特有的字段
键 |
描述 |
---|---|
来自已加载镜像的信息 返回: 始终 示例: |