herve4m.quay.quay_layer_info (1.2.0) — module

Gather information about image layers in Quay Container Registry

| "added in version" 0.0.1 of herve4m.quay"

Authors: Herve Quatremain (@herve4m)

Install collection

Install with ansible-galaxy collection install herve4m.quay:==1.2.0


Add to requirements.yml

  collections:
    - name: herve4m.quay
      version: 1.2.0

Description

Gather information about the layers of an image in a repository.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve the layers of the coreos/dnsmasq:latest image
  herve4m.quay.quay_layer_info:
    image: coreos/dnsmasq:latest
    quay_host: quay.io
  register: layers

Inputs

    
image:
    description:
    - Name of the image. The format is C(namespace)/C(repository):C(tag) or C(namespace)/C(repository)@C(digest).
      The namespace can be an organization or a personal namespace.
    - If you omit the namespace part, then the module looks for the repository in your
      personal namespace.
    - If you omit the tag and the digest part, then C(latest) is assumed.
    required: true
    type: str

quay_host:
    default: http://127.0.0.1
    description:
    - URL for accessing the API. U(https://quay.example.com:8443) for example.
    - If you do not set the parameter, then the module uses the C(QUAY_HOST) environment
      variable.
    - If you do no set the environment variable either, then the module uses the U(http://127.0.0.1)
      URL.
    type: str

quay_token:
    description:
    - OAuth access token for authenticating against the API.
    - If you do not set the parameter, then the module tries the C(QUAY_TOKEN) environment
      variable.
    - Mutually exclusive with I(quay_username) and I(quay_password).
    type: str

quay_password:
    description:
    - The password to use for authenticating against the API.
    - If you do not set the parameter, then the module tries the C(QUAY_PASSWORD) environment
      variable.
    - If you set I(quay_password), then you also need to set I(quay_username).
    - Mutually exclusive with I(quay_token).
    type: str

quay_username:
    description:
    - The username to use for authenticating against the API.
    - If you do not set the parameter, then the module tries the C(QUAY_USERNAME) environment
      variable.
    - If you set I(quay_username), then you also need to set I(quay_password).
    - Mutually exclusive with I(quay_token).
    type: str

validate_certs:
    aliases:
    - verify_ssl
    default: true
    description:
    - Whether to allow insecure connections to the API.
    - If C(no), then the module does not validate SSL certificates.
    - If you do not set the parameter, then the module tries the C(QUAY_VERIFY_SSL) environment
      variable (C(yes), C(1), and C(True) mean yes, and C(no), C(0), C(False), and no
      value mean no).
    type: bool

Outputs

layers:
  contains:
    command:
      description: The command that was used to build the layer.
      elements: str
      returned: always
      sample:
      - /bin/sh
      - -c
      - '#(nop) '
      - ENTRYPOINT ["/usr/sbin/dnsmasq"]
      type: list
    created_datetime:
      description: Layer creation date and time.
      returned: always
      sample: Thu, 30 Sep 2021 07:18:56 -0000
      type: str
    index:
      description: Index of the layer in the image.
      returned: always
      sample: 4
      type: int
  description: Sorted list of the image layers. The top layer is listed first.
  elements: dict
  returned: always
  sample:
  - author: Dalton Hubble <...>
    blob_digest: sha256:a3ed...46d4
    command:
    - /bin/sh
    - -c
    - '#(nop) '
    - ENTRYPOINT ["/usr/sbin/dnsmasq"]
    comment: null
    compressed_size: null
    created_datetime: Thu, 16 Nov 2017 22:24:12 -0000
    index: 6
    is_remote: false
    urls: null
  - author: Dalton Hubble <...>
    blob_digest: sha256:a3e...46d4
    command:
    - '/bin/sh -c #(nop)  EXPOSE 53/tcp 67/tcp 69/tcp'
    comment: null
    compressed_size: null
    created_datetime: Thu, 16 Nov 2017 22:24:12 -0000
    index: 5
    is_remote: false
    urls: null
  - author: Dalton Hubble <...>
    blob_digest: sha256:e40d...0351
    command:
    - '/bin/sh -c #(nop) COPY dir:5c38...5694 in /var/lib/tftpboot '
    comment: null
    compressed_size: null
    created_datetime: Thu, 16 Nov 2017 22:24:11 -0000
    index: 4
    is_remote: false
    urls: null
  - author: Dalton Hubble <...>
    blob_digest: sha256:7ef3...3a74
    command:
    - /bin/sh -c apk -U add dnsmasq curl
    comment: null
    compressed_size: null
    created_datetime: Thu, 16 Nov 2017 22:24:09 -0000
    index: 3
    is_remote: false
    urls: null
  - author: Dalton Hubble <...>
    blob_digest: sha256:a3ed...46d4
    command:
    - '/bin/sh -c #(nop)  MAINTAINER Dalton Hubble <...>'
    comment: null
    compressed_size: null
    created_datetime: Thu, 16 Nov 2017 22:24:04 -0000
    index: 2
    is_remote: false
    urls: null
  - author: null
    blob_digest: sha256:a3ed...46d4
    command:
    - '/bin/sh -c #(nop)  CMD ["/bin/sh"]'
    comment: null
    compressed_size: null
    created_datetime: Wed, 13 Sep 2017 14:32:26 -0000
    index: 1
    is_remote: false
    urls: null
  - author: null
    blob_digest: sha256:6d98...d913
    command:
    - '/bin/sh -c #(nop) ADD file:4583...9e45 in / '
    comment: null
    compressed_size: null
    created_datetime: Wed, 13 Sep 2017 14:32:25 -0000
    index: 0
    is_remote: false
    urls: null
  type: list