community.general.atomic_image (8.5.0) — module

Manage the container images on the atomic host platform

Authors: Saravanan KR (@krsacme)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage the container images on the atomic host platform.

Allows to execute the commands specified by the RUN label in the container image when present.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute the run command on rsyslog container image (atomic run rhel7/rsyslog)
  community.general.atomic_image:
    name: rhel7/rsyslog
    state: latest
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Pull busybox to the OSTree backend
  community.general.atomic_image:
    name: busybox
    state: latest
    backend: ostree

Inputs

    
name:
    description:
    - Name of the container image.
    required: true
    type: str

state:
    choices:
    - absent
    - latest
    - present
    default: latest
    description:
    - The state of the container image.
    - The state V(latest) will ensure container image is upgraded to the latest version
      and forcefully restart container, if running.
    type: str

backend:
    choices:
    - docker
    - ostree
    description:
    - Define the backend where the image is pulled.
    type: str

started:
    default: true
    description:
    - Start or Stop the container.
    type: bool

Outputs

msg:
  description: The command standard output
  returned: always
  sample: 'Using default tag: latest ...'
  type: str