Freedom251 › Infrastructure Testing Tools
Molecule
What Molecule is
Molecule is a free, MIT-licensed Ansible testing framework for developing roles, playbooks, and collections. It runs configurable workflows that can provision targets, install dependencies, prepare systems, converge configurations, check idempotence, verify results, clean up, and destroy resources. Targets can include containers, virtual machines, cloud infrastructure, APIs, databases, and network devices reachable from Ansible. Existing static inventories, dynamic scripts, and inventory plugins can be used. The `molecule test` command runs the configured sequence, while Molecule can also be invoked through Python. Documentation includes continuous-integration examples for GitHub Actions, Travis CI, GitLab CI, Azure Pipelines, Jenkins Pipeline, and Tox. Installation is through pip, with ansible-dev-tools recommended; Molecule is also in its container image. It supports only the latest two major Ansible versions and requires a recent ansible-core release. Drivers are available separately, often through molecule-plugins.
Who it suits
It suits Ansible role, playbook, and collection developers who need repeatable local or CI testing. It supports targets across AWS, Azure, GCP, containers, and other Ansible-reachable systems.
What it does well
- Free and MIT licensed
- Covers provisioning through verification and cleanup
- Works with existing Ansible inventories
- Provides examples for major CI systems
- Supports AWS, Azure, and GCP
What to know first
- Supports only the latest two Ansible major versions
- ansible-lint must be installed separately
- Installation requires Python packaging and management
Limits
Molecule supports only the latest two major Ansible versions. Selected drivers can require extra operating-system or Python packages, and ansible-lint is separate.
Getting started
- Install Python packaging and management tools on a Linux system
- Install Molecule with pip, preferably through ansible-dev-tools
- Create or use an Ansible project and inventory source
- Install any required driver through molecule-plugins or separately
- Run Molecule with `molecule` or `python3 -m molecule`
- Use `molecule test` to execute the configured workflow
Verdict
Molecule provides a structured way to exercise Ansible projects locally or in continuous integration. Its workflow flexibility and target support are useful, but version and environment requirements should be checked first.
Questions
Is Molecule free?
Yes. It is free, open source, and identified as MIT licensed.
Which platforms does Molecule support?
The listed platform is Linux.
How is Molecule installed?
The documentation names pip as the supported installation method and recommends ansible-dev-tools. It is also included in the Ansible Development Tools container image.
Which Ansible versions are supported?
Only the latest two major Ansible versions, N and N-1, are supported.
Can Molecule run in CI?
Documentation examples cover GitHub Actions, Travis CI, GitLab CI, Azure Pipelines, Jenkins Pipeline, and Tox.
Does Molecule include ansible-lint?
No. The installation guidance tells users to install ansible-lint separately.
Facts from Molecule's own pages
- Ansible versions
- Molecule supports only the latest two major versions of Ansible (N/N-1). · docs.ansible.com, 5 Oct 2026
- Ansible version support
- Molecule supports only the latest two major versions of Ansible. · docs.ansible.com, 5 Oct 2026
- CI
- The documentation gives a GitHub Actions example that installs dependencies and runs `molecule test`. · docs.ansible.com, 5 Oct 2026
- CI integrations
- The documentation provides continuous integration examples for GitHub Actions, Travis CI, GitLab CI, Azure Pipelines, Jenkins Pipeline, and Tox. · docs.ansible.com, 5 Oct 2026
- Command line
- Molecule can be invoked with the molecule command or as a Python module using python3 -m molecule. · docs.ansible.com, 5 Oct 2026
- Container option
- Molecule is included in the Ansible Development Tools container image. · docs.ansible.com, 5 Oct 2026
- Drivers
- Molecule uses the delegated driver by default, and other drivers can be installed separately, most through the molecule-plugins package. · docs.ansible.com, 5 Oct 2026
- Founded
- 2015 · docs.ansible.com, 28 Sept 2026
- Installation
- The documentation names pip as the only supported installation method and recommends installing Molecule through the ansible-dev-tools package. · docs.ansible.com, 5 Oct 2026
- Integrations
- Molecule uses Ansible features such as inventory, playbooks, and collections, and community drivers are available through molecule-plugins. · docs.ansible.com, 5 Oct 2026
- Inventory
- Molecule can use existing Ansible inventory sources, including static files, dynamic scripts, and inventory plugins. · docs.ansible.com, 5 Oct 2026
- License
- The project GitHub page identifies Molecule as MIT licensed. · github.com, 5 Oct 2026
- Notable limitation
- Molecule does not include ansible-lint; the installation documentation instructs users to install it separately. · docs.ansible.com, 5 Oct 2026
- Platform requirements
- Installation requires Python packaging and Python management on the system running Molecule, and the documentation gives package installation examples for CentOS and Ubuntu. · docs.ansible.com, 5 Oct 2026
- Pricing
- The project documentation provides pip installation instructions and does not list a paid plan or price. · docs.ansible.com, 5 Oct 2026
- Purpose
- Molecule is an Ansible testing framework for developing and testing collections, playbooks, and roles. · docs.ansible.com, 5 Oct 2026
- Requirements
- Molecule requires a recent supported version of ansible-core, and selected drivers may require additional operating system packages or Python packages. · docs.ansible.com, 5 Oct 2026
- Security
- The documentation recommends installing Molecule in a virtual environment and notes a possible issue on SELinux-supporting systems when installed into one. · docs.ansible.com, 5 Oct 2026
- Support
- The project directs users to the Ansible community forum for questions and help, and says possible security bugs can be reported to [email protected]. · docs.ansible.com, 5 Oct 2026
- Test targets
- Test scenarios can target systems and services reachable from Ansible, including containers, virtual machines, cloud infrastructure, APIs, databases, and network devices. · docs.ansible.com, 5 Oct 2026
- Test workflows
- Its configurable actions include provisioning, dependency installation, preparation, convergence, idempotence checks, verification, cleanup, and destruction. · docs.ansible.com, 5 Oct 2026
- Who it is for
- The getting-started guides direct Ansible role, playbook project, and collection developers to different testing paths. · docs.ansible.com, 5 Oct 2026
- Workflow
- The `molecule test` command runs a configurable sequence of testing actions, including syntax, create, converge, idempotence, and verify. · docs.ansible.com, 5 Oct 2026
Where Molecule stands on Freedom251
- Infrastructure Testing Tools#24 of 28