containers.podman.podman_image_info 模块 – 使用 Podman 收集镜像信息

注意

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

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

要安装它,请使用: ansible-galaxy collection install containers.podman

要在 playbook 中使用它,请指定: containers.podman.podman_image_info

概要

  • 使用 podman 收集镜像信息

参数

参数

注释

executable

字符串

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

默认值: "podman"

name

列表 / 元素=字符串

要收集信息的标签或 UID 列表。如果没有指定 name,则返回所有镜像的信息。

备注

注意

  • Podman 可能需要提升的权限才能正常运行。

示例

- name: Gather info for all images
  containers.podman.podman_image_info:

- name: Gather info on a specific image
  containers.podman.podman_image_info:
    name: nginx

- name: Gather info on several images
  containers.podman.podman_image_info:
    name:
      - redis
      - quay.io/bitnami/wildfly

返回值

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

描述

images

列表 / 元素=字符串

所有或指定镜像的信息

返回值:始终

示例: [{"Annotations": {}, "Architecture": "amd64", "Author": "", "Comment": "", "Config": {"Cmd": ["/bin/sh"], "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"]}, "Created": "2023-06-14T20:42:13.993588153Z", "Digest": "sha256:3362f865019db5f14ac5154cb0db2c3741ad1cce0416045be422ad4de441b081", "GraphDriver": {"Data": {"UpperDir": "/home/podman/.local/share/containers/storage/overlay/579b.../diff", "WorkDir": "/home/podman/.local/share/containers/storage/overlay/579b.../work"}, "Name": "overlay"}, "History": [{"created": "2023-06-14T20:42:13.893052319Z", "created_by": "/bin/sh -c #(nop) ADD file:234234234 in / "}, {"created": "2023-06-14T20:42:13.993588153Z", "created_by": "/bin/sh -c #(nop)  CMD [\"/bin/sh\"]", "empty_layer": true}], "Id": "029bed813f07be84fae0344cbf8076ced5ea3c929d5f064ba617ac7d8c610a4b", "Labels": null, "ManifestType": "application/vnd.docker.distribution.manifest.v2+json", "NamesHistory": ["quay.io/podman/alpine:3.15", "quay.io/podman/alpine:3.15", "docker.io/library/alpine:3.15"], "Os": "linux", "Parent": "", "RepoDigests": ["docker.io/library/alpine@sha256:3362f865019db5f14ac5154cb0db2c3741ad1cce0416045be422ad4de441b081", "docker.io/library/alpine@sha256:c58a2fce65cb3487f965d2fb08eec4843384dbe29264f427b665421db1aabef2", "quay.io/podman/alpine@sha256:3362f865019db5f14ac5154cb0db2c3741ad1cce0416045be422ad4de441b081", "quay.io/podman/alpine@sha256:c58a2fce65cb3487f965d2fb08eec4843384dbe29264f427b665421db1aabef2", "quay.io/podman/alpine@sha256:3362f865019db5f14ac5154cb0db2c3741ad1cce0416045be422ad4de441b081", "quay.io/podman/alpine@sha256:c58a2fce65cb3487f965d2fb08eec4843384dbe29264f427b665421db1aabef2"], "RepoTags": ["docker.io/library/alpine:3.15", "quay.io/podman/alpine:3.15", "quay.io/podman/alpine:3.15"], "RootFS": {"Layers": ["sha256:579b..."], "Type": "layers"}, "Size": 11745350, "User": "", "Version": "20.10.23", "VirtualSize": 11745350}]

作者

  • Sam Doran (@samdoran)