Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

Molecule

docs.ansible.com

  • Free plan
  • Linux
7.1 Club score Visit docs.ansible.com

What Molecule is

Molecule is a free, open-source Ansible testing framework for developing collections, playbooks, and roles. It runs locally on Linux and can test systems and services that Ansible can reach, including containers, virtual machines, cloud infrastructure, APIs, databases, and network devices. Configurable workflows cover provisioning, dependency installation, preparation, convergence, idempotence checks, verification, cleanup, and destruction. The `molecule test` command can run syntax, create, converge, idempotence, and verify stages. Molecule can use static inventories, dynamic scripts, and inventory plugins, and integrates with Ansible playbooks, collections, and community drivers. Documentation includes CI examples for GitHub Actions, Travis CI, GitLab CI, Azure Pipelines, Jenkins Pipeline, and Tox. Installation is through pip, with ansible-dev-tools recommended; it is also in the Ansible Development Tools container. Only the latest two major Ansible versions are supported, and ansible-lint must be installed separately.

Who it suits

Molecule suits Ansible role, playbook, and collection developers who need configurable local or CI testing across infrastructure targets.

Good to know, and what to watch

  • Free and open-source MIT-licensed project
  • Tests containers, clouds, APIs, databases, and devices
  • Configurable workflow includes idempotence and verification
  • Uses existing Ansible inventory sources
  • Examples cover major CI platforms
  • Supports only the latest two Ansible major versions
  • ansible-lint requires separate installation
  • Requires Python packaging and management setup
  • Selected drivers may need extra packages

The verdict

Molecule provides a structured way to test Ansible content across varied targets and CI systems. Its narrow Ansible version window and separate ansible-lint requirement should be planned for.

What the maker publishes

Ansible versions
Molecule supports only the latest two major versions of Ansible (N/N-1). source
Ansible version support
Molecule supports only the latest two major versions of Ansible. source
CI
The documentation gives a GitHub Actions example that installs dependencies and runs `molecule test`. source
CI integrations
The documentation provides continuous integration examples for GitHub Actions, Travis CI, GitLab CI, Azure Pipelines, Jenkins Pipeline, and Tox. source
Command line
Molecule can be invoked with the molecule command or as a Python module using python3 -m molecule. source
Container option
Molecule is included in the Ansible Development Tools container image. source
Drivers
Molecule uses the delegated driver by default, and other drivers can be installed separately, most through the molecule-plugins package. source
Founded
2015 source
Installation
The documentation names pip as the only supported installation method and recommends installing Molecule through the ansible-dev-tools package. source
Integrations
Molecule uses Ansible features such as inventory, playbooks, and collections, and community drivers are available through molecule-plugins. source
Inventory
Molecule can use existing Ansible inventory sources, including static files, dynamic scripts, and inventory plugins. source
License
The project GitHub page identifies Molecule as MIT licensed. source
Notable limitation
Molecule does not include ansible-lint; the installation documentation instructs users to install it separately. source
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. source
Pricing
The project documentation provides pip installation instructions and does not list a paid plan or price. source
Purpose
Molecule is an Ansible testing framework for developing and testing collections, playbooks, and roles. source
Requirements
Molecule requires a recent supported version of ansible-core, and selected drivers may require additional operating system packages or Python packages. source
Security
The documentation recommends installing Molecule in a virtual environment and notes a possible issue on SELinux-supporting systems when installed into one. source
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]. source
Test targets
Test scenarios can target systems and services reachable from Ansible, including containers, virtual machines, cloud infrastructure, APIs, databases, and network devices. source
Test workflows
Its configurable actions include provisioning, dependency installation, preparation, convergence, idempotence checks, verification, cleanup, and destruction. source
Who it is for
The getting-started guides direct Ansible role, playbook project, and collection developers to different testing paths. source
Workflow
The `molecule test` command runs a configurable sequence of testing actions, including syntax, create, converge, idempotence, and verify. source

Checked against the maker's pages on 5 Oct 2026.