finds.dev

ansible/molecule

An ansible-native testing framework for collections, playbooks, and roles with configurable workflows for testing any system or service

View on GitHubHomepage ↗

★ 4,163PythonMITupdated Nov 2026

// the take

Molecule is the standard framework for testing Ansible roles, playbooks, and collections by spinning up real or containerized targets, running a playbook against them, and asserting on the result. It's built for Ansible content authors who want more than ansible-lint and a `--check` run before merging changes.

The scenario lifecycle (create, converge, idempotence, verify, destroy) is the right model for infrastructure code: idempotence checking in particular catches roles that silently drift or fail on a second run, which plain CI rarely tests for. The delegated driver means you aren't locked into containers — point the create/destroy playbooks at anything Ansible can reach, including cloud instances or network gear. It's built entirely on Ansible primitives (inventory, playbooks, collections) instead of a bespoke test DSL, so there's nothing new to learn syntactically if you already write Ansible. Backing from the Ansible/Red Hat org plus the 'supports only latest two Ansible majors' policy keeps it from rotting the way a lot of community tooling does.

Full scenario runs are slow by nature — every scenario provisions and tears down infrastructure, so a matrix of platforms in CI adds real minutes, not seconds. The built-in Docker driver has been deprecated in favor of Podman/delegated over recent major versions, which has broken existing `molecule.yml` configs for people upgrading and pushed users into writing their own create/destroy playbooks for anything beyond the basics. The two-major-version support window means teams stuck on an older Ansible release are also stuck on an older, less-maintained Molecule. Verification typically pulls in Testinfra or pytest on top of Ansible assertions, so there's a second test framework's assumptions to hold in your head alongside Ansible's own.

We read the README, the directory tree and a key source file in November 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
4,163
Forks
678
Language
Python
License
MIT
Last commit
2 Nov 2026

// nearby

If molecule isn't quite it.

All repos →