Registry / devops / molecule-vagrant

molecule-vagrant

JSON →
library2.0.0pypypiunverified

Molecule Vagrant is a plugin for the Molecule testing framework, enabling users to provision and test Ansible roles and playbooks on Vagrant-managed virtual machines. It integrates the robust local virtualization capabilities of Vagrant with Molecule's structured testing approach. The current version is 2.0.0, with releases typically aligning with major Molecule updates or significant breaking changes.

pip install molecule-vagrant
INSTALL
IMPORT
SIG · MOLECULE-VAGRANT
M
molecule-vagrant
devopspythonv2.0.0
Install
7.0s avg
Import
Disk
77MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 74MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.0s · import 0.000s · 75MB
77MB installed
● package 77MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

driver.name
In molecule.yml: driver: name: vagrant
from molecule_vagrant import VagrantDriver
molecule-vagrant is a plugin configured via molecule.yml, not typically imported directly in Python code by end-users.

This quickstart demonstrates how to initialize a Molecule scenario with the Vagrant driver, configure a basic Vagrant box in `molecule.yml`, and execute the Molecule test sequence. Remember that Vagrant and a provider must be installed separately on your system.

# 1. Install Molecule and the Vagrant driver: # pip install molecule molecule-vagrant # 2. Ensure Vagrant and a provider (e.g., VirtualBox) are installed system-wide. # 3. Create a new Molecule project using the vagrant driver: # molecule init scenario --driver-name vagrant --role-name my-test-role # 4. Modify the generated molecule.yml to configure your Vagrant box: # This example uses 'generic/alpine316' for speed and minimal resources. # --- begin .molecule/my-test-role/molecule.yml --- # For a real project, replace 'my-test-role' with your actual role name. # lint: ignore driver: name: vagrant platforms: - name: instance box: generic/alpine316 memory: 256 cpus: 1 provider_options: memory: 256 cpus: 1 provisioner: name: ansible inventory: group_vars: all: ansible_python_interpreter: /usr/bin/python3 verifier: name: ansible # --- end .molecule/my-test-role/molecule.yml --- # 5. Run your Molecule tests: # cd my-test-role # molecule test
molecule --version
Debug
Known issues
breakingPython 3.8 support was removed in v2.0.0. Python 3.6 and 3.7 support was removed in v1.0.0, and further reiterated in v2.0.0. The library now requires Python >= 3.9.
fix
Upgrade your Python environment to 3.9 or newer before installing molecule-vagrant 2.0.0+.
affects: < 2.0.0
breakingThe `ansible` extra dependency was removed in v1.0.0. Molecule-vagrant no longer automatically installs `ansible`.
fix
Ensure `ansible` is installed in your Python environment explicitly (e.g., `pip install ansible`) before running Molecule tests.
affects: < 1.0.0
gotchaMolecule-vagrant requires the `vagrant` command-line tool and a Vagrant provider (e.g., VirtualBox, Libvirt, VMware Workstation) to be installed and configured on your host system.
fix
Install Vagrant (https://www.vagrantup.com/downloads) and your chosen virtualization provider (e.g., VirtualBox https://www.virtualbox.org/wiki/Downloads) separately.
affects: All versions
gotchaSpecific versions of `molecule-vagrant` require compatible versions of `molecule`. For example, v1.0.0 requires `molecule >= 3.4.1`, and v0.5 required `molecule >= 3.2`.
fix
Consult the `pyproject.toml` or `setup.cfg` of your `molecule-vagrant` version for the exact `molecule` dependency range and ensure you install a compatible `molecule` version.
affects: All versions
Upgrade
Version history
2.0.0latest on PyPI · released Jan 6, 2023
Audit
Dependencies
moleculerequiredCore dependency for Molecule functionality.
Vagrant (external tool)requiredRequired external virtualization tool to provision instances.
Vagrant Provider (e.g., VirtualBox, Libvirt, VMware Workstation) (external tool)requiredRequired external virtualization provider for Vagrant to create VMs.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
molecule-vagrant — pip install molecule-vagrant · libregistry