containers.podman.podman_logout (1.12.1) — module

Log out of a container registry using podman

Authors: Clemens Lange (@clelange)

Install collection

Install with ansible-galaxy collection install containers.podman:==1.12.1


Add to requirements.yml

  collections:
    - name: containers.podman
      version: 1.12.1

Description

Log out of a container registry server using the podman logout command by deleting the cached credentials stored in the `auth.json` file. If the registry is not specified, the first registry under `[registries.search]` from `registries.conf `will be used. The path of the authentication file can be overridden by the user by setting the `authfile` flag. The default path used is `${XDG_RUNTIME_DIR}/containers/auth.json`. All the cached credentials can be removed by setting the `all` flag. Warning - podman will use credentials in `${HOME}/.docker/config.json` to authenticate in case they are not found in the default `authfile`. However, the logout command will only removed credentials in the `authfile` specified.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Log out of default registry
  podman_logout:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Log out of quay.io
  podman_logout:
    registry: quay.io
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Log out of all registries in auth file
  podman_logout:
    all: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Log out of all registries in specified auth file
  podman_logout:
    authfile: $HOME/.docker/config.json
    all: true

Inputs

    
all:
    description:
    - Remove the cached credentials for all registries in the auth file.
    type: bool

authfile:
    description:
    - Path of the authentication file. Default is ``${XDG_RUNTIME_DIR}/containers/auth.json``
      You can also override the default path of the authentication file by setting the
      ``REGISTRY_AUTH_FILE`` environment variable. ``export REGISTRY_AUTH_FILE=path``
    type: path

registry:
    description:
    - Registry server. If the registry is not specified, the first registry under `[registries.search]`
      from `registries.conf` will be used.
    type: str

executable:
    default: podman
    description:
    - Path to C(podman) executable if it is not in the C($PATH) on the machine running
      C(podman)
    type: str

ignore_docker_credentials:
    description:
    - Credentials created using other tools such as `docker login` are not removed unless
      the corresponding `authfile` is explicitly specified. Since podman also uses existing
      credentials in these files by default (for docker e.g. `${HOME}/.docker/config.json`),
      module execution will fail if a docker login exists for the registry specified in
      any `authfile` is used by podman. This can be ignored by setting `ignore_docker_credentials`
      to `true` - the credentials will be kept and `changed` will be false. This option
      cannot be used together with `all` since in this case podman will not check for
      existing `authfiles` created by other tools.
    type: bool