{"id":4987,"library":"molecule-plugins","title":"Molecule Plugins","description":"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.","status":"active","version":"25.8.12","language":"en","source_language":"en","source_url":"https://github.com/ansible-community/molecule-plugins","tags":["ansible","molecule","testing","plugins","docker","podman","vagrant","cloud-testing","azure","ec2","gce","openstack"],"install":[{"cmd":"pip install 'molecule-plugins[docker]' 'molecule-plugins[podman]' # or other drivers like azure, ec2, gce, openstack, vagrant","lang":"bash","label":"Install with specific drivers"},{"cmd":"pip install molecule # Molecule core\npip install 'molecule-plugins[all]' # Install all available drivers (may pull many dependencies)","lang":"bash","label":"Install Molecule core and all plugins"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false},{"reason":"Molecule Plugins requires Molecule core version 5 or newer.","package":"molecule>=5.0.0","optional":false},{"reason":"Molecule and its plugins are used for testing Ansible content.","package":"ansible-core>=2.12","optional":false},{"reason":"Required for the Docker driver; installed via 'molecule-plugins[docker]'.","package":"community.docker","optional":true},{"reason":"Required for the Vagrant driver; installed via 'molecule-plugins[vagrant]'.","package":"python-vagrant","optional":true}],"imports":[],"quickstart":{"code":"# 1. Initialize an Ansible role (since Molecule 6.0.0, use ansible-galaxy init)\nansible-galaxy role init my_ansible_role\ncd my_ansible_role\n\n# 2. Initialize a Molecule scenario (e.g., with docker driver)\n# A molecule.yml file will be created in molecule/default\nmolecule init scenario default --driver-name docker --verifier-name ansible\n\n# 3. Modify molecule/default/molecule.yml if needed (e.g., specify platform image)\n# Example snippet for molecule/default/molecule.yml:\n# platforms:\n#   - name: instance\n#     image: 'docker.io/pycontribs/centos:8'\n#     pre_build_image: true\n\n# 4. Run tests for the default scenario\nmolecule test --all","lang":"bash","description":"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."},"warnings":[{"fix":"Before installing `molecule-plugins`, run `pip uninstall molecule-docker molecule-azure ...` for any previously installed individual driver packages.","message":"When migrating from individual driver packages (e.g., `molecule-docker`, `molecule-azure`) to `molecule-plugins`, you *must* uninstall the old standalone packages first. Failing to do so will result in a broken setup due to multiple plugins registering the same entry points.","severity":"breaking","affected_versions":"All versions migrating from standalone drivers"},{"fix":"Replace `molecule init role <name>` with `ansible-galaxy role init <name>` to create the role structure, then navigate into the role and use `molecule init scenario <name>`.","message":"The `molecule init role` command was removed in Molecule version 6.0.0. To initialize an Ansible role, use `ansible-galaxy role init` instead.","severity":"breaking","affected_versions":"Molecule >= 6.0.0"},{"fix":"Always install `molecule-plugins` with the specific driver extras you intend to use, e.g., `pip install 'molecule-plugins[docker]'`.","message":"Installing `molecule-plugins` alone does not install the underlying tools or Python libraries required by each driver (e.g., Docker daemon, Podman, Vagrant, `community.docker` Python collection, `python-vagrant`). These must be installed by specifying extras, for example, `pip install 'molecule-plugins[docker]'`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade `molecule-plugins` to v23.6.0 or newer. If unable to upgrade, workarounds might include directly using `vagrant ssh <id>` for Vagrant or checking specific driver documentation for alternatives.","message":"For `molecule-plugins` versions prior to v23.6.0, the `molecule login --host <hostname>` command might not work correctly, potentially due to issues with port templating.","severity":"gotcha","affected_versions":"< 23.6.0"},{"fix":"Consult the Ansible Molecule documentation regarding SELinux considerations. Potential workarounds might involve specific SELinux policy adjustments or installing system-wide (though virtual environments are generally recommended).","message":"On SELinux-enabled systems, installing Molecule or its plugins into a virtual environment may lead to issues (e.g., issue 34340), even if SELinux is not explicitly enabled or is in permissive mode.","severity":"gotcha","affected_versions":"All versions on SELinux systems"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}