{"library":"molecule-vagrant","title":"Molecule Vagrant Driver","description":"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.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install molecule-vagrant"],"cli":{"name":"molecule","version":"molecule 26.4.0 using python 3.11"}},"imports":["In molecule.yml:\ndriver:\n  name: vagrant"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# 1. Install Molecule and the Vagrant driver:\n# pip install molecule molecule-vagrant\n\n# 2. Ensure Vagrant and a provider (e.g., VirtualBox) are installed system-wide.\n\n# 3. Create a new Molecule project using the vagrant driver:\n# molecule init scenario --driver-name vagrant --role-name my-test-role\n\n# 4. Modify the generated molecule.yml to configure your Vagrant box:\n# This example uses 'generic/alpine316' for speed and minimal resources.\n\n# --- begin .molecule/my-test-role/molecule.yml ---\n# For a real project, replace 'my-test-role' with your actual role name.\n\n# lint: ignore\ndriver:\n  name: vagrant\n\nplatforms:\n  - name: instance\n    box: generic/alpine316\n    memory: 256\n    cpus: 1\n    provider_options:\n      memory: 256\n      cpus: 1\n\nprovisioner:\n  name: ansible\n  inventory:\n    group_vars:\n      all:\n        ansible_python_interpreter: /usr/bin/python3\n\nverifier:\n  name: ansible\n# --- end .molecule/my-test-role/molecule.yml ---\n\n# 5. Run your Molecule tests:\n# cd my-test-role\n# molecule test\n","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}