containers.podman.podman_volume_info 模块 – 收集关于 podman 卷的信息

注意

此模块是 containers.podman 集合(版本 1.16.2)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install containers.podman。您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。

要在剧本中使用它,请指定:containers.podman.podman_volume_info

概要

  • 使用 podman inspect 命令收集有关 podman 卷的信息。

要求

执行此模块的主机需要以下要求。

  • 主机上安装了 Podman

参数

参数

注释

可执行文件

字符串

如果 podman 可执行文件不在运行 podman 的机器上的 $PATH 中,则指向该可执行文件的路径

默认值: "podman"

名称

字符串

卷的名称

示例

- name: Gather info about all present volumes
  podman_volume_info:

- name: Gather info about specific volume
  podman_volume_info:
    name: specific_volume

返回值

常见的返回值记录在这里,以下是此模块特有的字段

描述

列表 / 元素=字符串

来自所有或指定卷的事实

返回: 总是

示例: [{"CreatedAt": "2023-11-30T16:41:31.310865559+02:00", "Driver": "local", "Labels": {}, "LockNumber": 18, "MountCount": 0, "Mountpoint": "/home/user/.local/share/containers/storage/volumes/postgres9/_data", "Name": "postgres9", "NeedsChown": true, "NeedsCopyUp": true, "Options": {}, "Scope": "local"}]

作者

  • Sagi Shnaidman (@sshnaidm)