community.general.atomic_container module – Manage the containers on the atomic host platform

Note

This module is part of the community.general collection (version 6.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.general.atomic_container.

Synopsis

  • Manage the containers on the atomic host platform.

  • Allows to manage the lifecycle of a container on the atomic host platform.

Requirements

The below requirements are needed on the host that executes this module.

  • atomic

  • python >= 2.6

Parameters

Parameter

Comments

backend

string / required

Define the backend to use for the container.

Choices:

  • "docker"

  • "ostree"

image

string / required

The image to use to install the container.

mode

string

Define if it is an user or a system container.

Choices:

  • "user"

  • "system"

name

string / required

Name of the container.

rootfs

string

Define the rootfs of the image.

state

string

State of the container.

Choices:

  • "absent"

  • "latest" ← (default)

  • "present"

  • "rollback"

values

list / elements=string

Values for the installation of the container.

This option is permitted only with mode ‘user’ or ‘system’.

The values specified here will be used at installation time as –set arguments for atomic install.

Default: []

Notes

Note

  • Host should support atomic command

Examples

- name: Install the etcd system container
  community.general.atomic_container:
    name: etcd
    image: rhel/etcd
    backend: ostree
    state: latest
    mode: system
    values:
        - ETCD_NAME=etcd.server

- name: Uninstall the etcd system container
  community.general.atomic_container:
    name: etcd
    image: rhel/etcd
    backend: ostree
    state: absent
    mode: system

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

msg

string

The command standard output

Returned: always

Sample: "Using default tag: latest ..."

Authors

  • Giuseppe Scrivano (@giuseppe)