Ansible CI/CD container for ansible_cicd_rockylinux8
4.0K
This repository provides prebuilt Docker images for Ansible-based CI/CD pipelines, built on multiple Linux distributions with Python and commonly used Ansible dependencies.
Each image is built for a specific OS to match production environments or CI runner needs:
ubuntu2404 โ Ubuntu 24.04ubuntu2604 โ Ubuntu 26.04debian12 โ Debian Bookwormdebian13 โ Debian Trixierockylinux8 โ Rocky Linux 8rockylinux9 โ Rocky Linux 9alpine3.22 โ Alpine 3.22alpine3.23 โ Alpine 3.23Only the latest two versions per distro family are actively built and maintained. Older Docker Hub images remain available but are no longer updated.
Default tags point to the newest supported version for each distro family:
ubuntu โ Ubuntu 26.04debian โ Debian Trixierockylinux โ Rocky Linux 9alpine3 โ Alpine 3.23Each image is tagged as:
bsmeding/ansible_cicd_<tag>:latest
Each image includes:
pip, setuptools, wheelpynautobot, pynetboxyamllint, cryptography, jmespath, netaddr, pywinrmAlpine images are optimized for minimal footprint, while Debian/Rocky images offer compatibility with more complex Ansible roles and Python modules.
These images are great for:
jobs:
test:
runs-on: ubuntu-latest
container:
image: bsmeding/ansible_cicd_ubuntu2404:latest
steps:
- uses: actions/checkout@v4
- run: ansible-playbook playbook.yml
These images are optimized for Molecule testing of Ansible roles. The images include systemd support and are pre-configured with Ansible and common dependencies.
Create a molecule/default/molecule.yml file in your Ansible role:
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: "bsmeding/ansible_cicd_${MOLECULE_DISTRO:-ubuntu2404}:latest"
command: ${MOLECULE_DOCKER_COMMAND:-"/lib/systemd/systemd"}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
cgroupns_mode: host
tmpfs:
- /run
- /run/lock
environment:
container: docker
privileged: true
pre_build_image: true
provisioner:
name: ansible
config_options:
defaults:
gather_facts: true
remote_tmp: /var/tmp/.ansible
roles_path: "../../../"
command: /lib/systemd/systemd - Overrides the default bash CMD to enable systemd (required for service management)privileged: true - Required for systemd to function properlycgroupns_mode: host - Allows systemd to manage cgroupsvolumes: /sys/fs/cgroup:/sys/fs/cgroup:rw - Mounts cgroup filesystem for systemdUse environment variables to test different distributions:
# Test on Ubuntu 24.04
MOLECULE_DISTRO=ubuntu2404 molecule test
# Test on Debian 12
MOLECULE_DISTRO=debian12 molecule test
# Test on Rocky Linux 9
MOLECULE_DISTRO=rockylinux9 molecule test
For roles that need Docker (e.g., deploying containers), add Docker socket access:
platforms:
- name: instance
image: bsmeding/ansible_cicd_${MOLECULE_DISTRO:-ubuntu2404}:latest
command: /lib/systemd/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/run/docker.sock:/var/run/docker.sock
cgroupns_mode: host
privileged: true
pre_build_image: true
environment:
DOCKER_HOST: unix:///var/run/docker.sock
capabilities:
- SYS_ADMIN
- NET_ADMIN
- SYS_CHROOT
# ... additional capabilities as needed
The images are pre-configured with the correct Python interpreter path (/opt/venv/bin/python). When you install additional packages via pip install in your CI/CD pipeline, they will be automatically available to Ansible since everything runs in the same virtual environment.
Note: Alpine images use /bin/sh as the default CMD and don't support systemd. Use Debian/Ubuntu/Rocky images for roles that require systemd.
All images are pushed to Docker Hubโ :
๐ฆ bsmeding/ansible_cicd_ubuntu2404โ
๐ฆ bsmeding/ansible_cicd_debian13โ
... and more!
Feel free to open issues or PRs if:
MIT
bsmedingโ โ Built for reproducible Ansible pipelines and fast Molecule testing.
Content type
Image
Digest
sha256:0e7e61830โฆ
Size
438.6 MB
Last updated
5 months ago
docker pull bsmeding/ansible_cicd_rockylinux8