-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for global molecule configuration #89
Conversation
Ready for reviews ;-) |
ea8181e
to
291dfa5
Compare
This patch adds the support for molecule base configuration. It will allow us to use a global molecule configuration file[1] or to pass one or multiple base configuration file(s) according to ansible-molecule through the tox.ini file and the `molecule_config_files` option. By default, if not passing base configuration file(s) in the tox.ini file but if there is a global configuration file[1], this will be the reference to determine the driver name if the scenarios configuration files didn't override the default one coming from the global one[1]. If there is [1] at the project level and passing base configuration file(s) in the tox.ini file, those latter will take precedence over the global one[1]. Note that tox-ansible will now raise a RuntimeError if it finds out multiple driver name declaration when using multiple molecule base configuration. [1] - <PROJECT_ABSPATH>/.config/molecule/config.yml Fixes ansible#88 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
I'm going to merge this as-is. I think it's worth noting that there's no reason a user can't configure the Driver in multiple base config files, to my knowledge. (I'd like to hear from @ssbarnea on that) So, if someone needs that ability, they can open an issue to relax that. But, as it is, this likely solves 99% of the problems people will have. |
It could happen and it's called a human mistake IMO. We should have only one default driver declared in base config file(s) and could possibly be overriden through the molecule.yml file of your scenarios. Btw, I still don't understand why we are able to pass multiple base config files to molecule ... Isn't one just enough? :/ |
@greg-hellings Anyway, Thank you for merging this pull request 👍 |
Could you please guys make a new release including this PR as soon as possible ? |
I disagree. I can totally see having a default one that I use on my development rig that has lots of things configured, including running tests with Vagrant/Libvirt and an additional file that I include during CI runs that overrides it to use Vagrant/VirtualBox or the like.
Molecule does a deep-merging when multiple are found. It could make sense to have a base option to configure things like dependency options, ansible.cfg options, and verifier options. Then include different files based on being on a Developer machine, different CI environments, stage, etc. It's possible - I don't know that it's common, but it makes sense in some complex setups. |
[1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I259c17b7a49ff5bf3476df4da399cc4b2782403d
[1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Change-Id: I8ac3f731c9d6af983dd902fc94e06a07c2ab9954 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
* Update validations-common from branch 'master' to ae6c7e506d890a9af4cf6d7be5d8aa56f7ee31e8 - Merge "Remove workaround for tox-ansible and global molecule config" - Remove workaround for tox-ansible and global molecule config [1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Change-Id: I8ac3f731c9d6af983dd902fc94e06a07c2ab9954 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
* Update tripleo-validations from branch 'master' to a9a0ab6433bdbba43894e64e08cfcd347aa13207 - Merge "Remove workaround for tox-ansible and global molecule config" - Remove workaround for tox-ansible and global molecule config [1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I259c17b7a49ff5bf3476df4da399cc4b2782403d
[1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I259c17b7a49ff5bf3476df4da399cc4b2782403d (cherry picked from commit c551910)
[1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I259c17b7a49ff5bf3476df4da399cc4b2782403d (cherry picked from commit c551910) (cherry picked from commit f3cba82) (cherry picked from commit 12dd20e3b55e96d88468531f8752b9bcea21360b)
[1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I259c17b7a49ff5bf3476df4da399cc4b2782403d (cherry picked from commit c551910) (cherry picked from commit f3cba82)
[1] has been merged and released[2] in upstream tox-ansible and it is now able to manage global molecule configuration. The workaround, which consisted in adding the molecule driver name in each scenarios molecule.yml files, is not necessary anymore. This patch also removes all the relative symlink to the Dockerfile and adds directly in the global molecule configuration file. [1] ansible/tox-ansible#89 [2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0 Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: I259c17b7a49ff5bf3476df4da399cc4b2782403d (cherry picked from commit c551910) (cherry picked from commit f3cba82) (cherry picked from commit 12dd20e3b55e96d88468531f8752b9bcea21360b) (cherry picked from commit 76eb983e9842e38a95940787af2fdda540e2a83b)
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file.
By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].
If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].
Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.
[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml
Fixes #88
Signed-off-by: Gael Chamoulaud (Strider) gchamoul@redhat.com