Molecule Plugins

25.8.12 · active · verified Sun Apr 12

Molecule Plugins is a monorepository containing various drivers for the Molecule Ansible testing framework, including Azure, Docker, EC2, GCE, OpenStack, Podman, and Vagrant. It centralizes the development and maintenance of these plugins to ensure compatibility and reduce overhead. Molecule itself is an Ansible testing framework designed for developing and testing Ansible collections, playbooks, and roles. The library is actively maintained with a CalVer release cadence, with the current version being 25.8.12.

Warnings

Install

Quickstart

This quickstart demonstrates how to set up an Ansible role with a Molecule test scenario using the Docker driver. After initializing the role and scenario, you can customize the `molecule.yml` to define your test platforms and then execute the tests.

# 1. Initialize an Ansible role (since Molecule 6.0.0, use ansible-galaxy init)
ansible-galaxy role init my_ansible_role
cd my_ansible_role

# 2. Initialize a Molecule scenario (e.g., with docker driver)
# A molecule.yml file will be created in molecule/default
molecule init scenario default --driver-name docker --verifier-name ansible

# 3. Modify molecule/default/molecule.yml if needed (e.g., specify platform image)
# Example snippet for molecule/default/molecule.yml:
# platforms:
#   - name: instance
#     image: 'docker.io/pycontribs/centos:8'
#     pre_build_image: true

# 4. Run tests for the default scenario
molecule test --all

view raw JSON →