I was hopping to be able to choose the ansible version used for my test since it is often to have older anbsible-core version used in production environment than the one used internally by molecule.
As an alternative, I tried to see if there was an option to define the ansible-playbook binary path to a virtualenv containing the ansible-playbook version targeted without success.
Is there anyway to achieve what I’m looking for ?
If no, is there any plan to add this possibility to molecule ? I assume it will be really nice
The missing note is that you manage running molecule against multiple Ansible versions outside molecule, not inside of it.
In other words you make some scripting outside molecule to run molecule in different Ansible venvs. You can possibly even run all the scenarios for different Ansible versions in parallel.
There is no much sense in supporting something like this in molecule itself because molecule also depends on some venv.
that’s not what I’m looking for, having tox + pyenv is indeed easy to run different ansible + molecule version.
What I’m looking for is a way to run my tests against different ansible version with the exact same molecule version.
it is a long time since I dig into molecule source code but from what I remembered, ansible was called as a system command and not by using it as a module, so IMO ansible is executed outside of molecule not inside of it.
Not exactly, what I was looking for is a way to use an alternate ansible binary (who live in a dedicated venv) for some sequences : converge and idempotence
Don’t remember it was used by molecule itself when running it and don’t get the reason for its use, will try to dig in source code to understand its use