-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Molecule generates wrong Vagrantfile when not defining 'provider' #66
Comments
The problem is that it's vagrant itself which is choosing the "right" driver, and at time of writing the Vagrantfile, we have no way to know if vagrant will use a different driver. Vagrant will choose say libvirt instead of vbox when reading the Vagrantfile, which is too late, since here, it means when launching the VM. There has been ansible-community/molecule-vagrant#174 about similar problem. I've suggested to have a rewrite to create an option to allow forcing the provider but nothing happened yet. Maybe I'll create a PR. The other possibility would be to write the Vagrantfile, maybe use fwiw, the |
Currently, vagrant is still choosing the provider to use on its own liking. While it's fine for cases like our CI or people who are fine with default VM configurations, it's not always the case. See: - ansible-community#174 - https://github.com/ansible-community/molecule-vagrant/issues/181 So, add a new configuration setting to call vagrant up with --provider, in order to force the provider to use and lead to an error if it's not usable. The default value is to keep current behaviour to not break things. Signed-off-by: Arnaud Patard <[email protected]>
Currently, vagrant is still choosing the provider to use on its own liking. While it's fine for cases like our CI or people who are fine with default VM configurations, it's not always the case. See: - ansible-community#174 - https://github.com/ansible-community/molecule-vagrant/issues/181 So, add a new configuration setting to call vagrant up with --provider, in order to force the provider to use and lead to an error if it's not usable. The default value is to keep current behaviour to not break things. Signed-off-by: Arnaud Patard <[email protected]>
Currently, vagrant is still choosing the provider to use on its own liking. This may cause troubles like VM memory/cpus or provider options ignored if the provider use is not the one specified. See: - ansible-community#174 - https://github.com/ansible-community/molecule-vagrant/issues/181 So, pass --provider when the provider is set in the molecule.yml. If the test doesn't care about the provider, it should remove the provider name setting in the molecule.yml. Note: While this may break some setup, I believe this will prevent new reports/issues like the one previously noted. In case one molecule.yml file for multiple providers is wanted, use the new providers_options, as done in our CI scenario. Signed-off-by: Arnaud Patard <[email protected]>
Currently, vagrant is still choosing the provider to use on its own liking. This may cause troubles like VM memory/cpus or provider options ignored if the provider use is not the one specified. See: - ansible-community#174 - https://github.com/ansible-community/molecule-vagrant/issues/181 So, pass --provider when the provider is set in the molecule.yml. If the test doesn't care about the provider, it should remove the provider name setting in the molecule.yml. Note: While this may break some setup, I believe this will prevent new reports/issues like the one previously noted. In case one molecule.yml file for multiple providers is wanted, use the new providers_options, as done in our CI scenario. Signed-off-by: Arnaud Patard <[email protected]>
Currently, vagrant is still choosing the provider to use on its own liking. This may cause troubles like VM memory/cpus or provider options ignored if the provider use is not the one specified. See: - ansible-community#174 - https://github.com/ansible-community/molecule-vagrant/issues/181 So, pass --provider when the provider is set in the molecule.yml. If the test doesn't care about the provider, it should remove the provider name setting in the molecule.yml. Note: While this may break some setup, I believe this will prevent new reports/issues like the one previously noted. In case one molecule.yml file for multiple providers is wanted, use the new providers_options, as done in our CI scenario. Signed-off-by: Arnaud Patard <[email protected]>
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:
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
The text was updated successfully, but these errors were encountered: