ansible-community / ansible-community/molecule-plugins

Molecule generates wrong Vagrantfile when not defining 'provider'

Open
#66 1 comment 0 reactions 0 assignees View on GitHub
vagrant
Dominant language
Python
Stars
164
Forks
113
Avg merge
4d 20h
Merged PRs (30d)
1

Description

As we have different environments, where we need to run molecule tests. We have a curious problem.

We have defined the driver in _molecule.yml_:
```
driver:
name: vagrant
```
Running our tests, molecule will choose the correct provider automatically. In our case _virtualbox_ or _libvirt_. In default _virtualbox_ is the default provider, but if it's not installed, _libvirt_ will be chosen (if it's installed). The virtual machines will be setup, but not with the correct settings, if defined (like memory or cpus).

The problem is, that the underlying Vagrantfile will be generated for "virtualbox", even if it's not installed and the virtual machines were setup up for libvirt. Only if I define "libvirt" as provider in the molecule.yml, the file will be generated correctly. So the drive don't use the same driver as vagrant, if not set explicity

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a molecule.yml that names only the vagrant driver, using environments where virtualbox is unavailable and libvirt is selected. Compare the generated Vagrantfile with the provider actually used and verify that provider-specific settings such as memory and CPUs are applied consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.