Skip to content

clifford2/molecule-containers

Repository files navigation

Container Images for Ansible Molecule

About

This code builds container images for various Linux distributions, for use as Ansible molecule testing platforms.

Two varieties are available, namely:

  • Podman / Docker images, for testing your playbooks in Podman or Docker containers
  • containerDisk images, for testing your playbooks in KubeVirt VMs

Podman / Docker Images

Containerfiles

Our Containerfiles (in the podman/ directory):

Linux Distribution Containerfile Image name
CentOS Stream 8 Containerfile.centos-stream8 molecule-platform:centos8
CentOS Stream 9 Containerfile.centos-stream9 molecule-platform:centos9
Debian 12 (Bookworm) Containerfile.debian12 molecule-platform:debian12
Fedora 40 Containerfile.fedora40 molecule-platform:fedora40
Fedora 41 Containerfile.fedora41 molecule-platform:fedora41
Fedora 42 Containerfile.fedora42 molecule-platform:fedora42
SLE BCI (SLES 15) based Containerfile.sle15 molecule-platform:sle15
Ubuntu 22.04 (Jammy Jellyfish) Containerfile.ubuntu2204 molecule-platform:ubuntu2204
Ubuntu 24.04 (Noble Numbat) Containerfile.ubuntu2404 molecule-platform:ubuntu2404

Example Containerfiles:

Build Instructions

Container images built from these files are available at https://hub.docker.com/r/cliffordw/molecule-platform.

To build your own images from this source, you can build all images with:

make build-container

Or build individual images with these commands:

podman build -f podman/Containerfile.centos-stream8 -t molecule-platform:centos8 .
podman build --pull -f podman/Containerfile.centos-stream9 -t molecule-platform:centos9 .
podman build -f podman/Containerfile.debian12 -t molecule-platform:debian12 .
podman build --pull -f podman/Containerfile.fedora40 -t molecule-platform:fedora40 .
podman build --pull -f podman/Containerfile.fedora41 -t molecule-platform:fedora41 .
podman build --pull -f podman/Containerfile.fedora42 -t molecule-platform:fedora42 .
podman build -f podman/Containerfile.sle15 -t molecule-platform:sle15 .
podman build -f podman/Containerfile.ubuntu2204 -t molecule-platform:ubuntu2204 .
podman build -f podman/Containerfile.ubuntu2404 -t molecule-platform:ubuntu2404 .

Additional Images

Other images that already contain systemd:

Molecule Example

An example Molecule configuration can be found in molecule/podman/.

Run with:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install molecule 'ansible-core<2.17'
molecule test -s podman

KubeVirt containerDisk Images

An example Molecule configuration can be found in molecule/podman/.

Containerfiles

Our Containerfiles (in the kubevirt/ directory):

Build Instructions

Container images built from these files are available at https://hub.docker.com/r/cliffordw/kubevirt-containerdisk.

To build your own images from this source, you can build all images with:

make build-vm

Additional Images

Other available images (requires authentication to pull):

  • registry.redhat.io/rhel9/rhel-guest-image
  • registry.redhat.io/rhel8/rhel-guest-image

Molecule Example

An example Molecule configuration can be found in molecule/kubevirt/.

Run with:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install molecule 'ansible-core<2.17'
python3 -m pip install -r molecule/shared/kubevirt-requirements.txt
molecule test -s kubevirt

License & Disclaimer

The original Debian systemd Dockerfile example, in which some of our images are based, is © 2018-2019 Alexander Haase ahaase@alexhaase.de.

Modifications, and all other files are © 2025 Clifford Weinmann https://www.cliffordweinmann.com/.

This code is provided AS IS, without warranty of any kind. See LICENSES/ for the full license text and disclaimers.

Security

This code is updated as often as possible, but support is provided on a best effort basis only.

Please report any problems or vulnerabilities by opening a GitHub issue here.

About

Container images for Ansible Molecule testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages