-
Notifications
You must be signed in to change notification settings - Fork 656
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 doesn't respect ANSIBLE_ROLES_PATH
or ANSIBLE_COLLECTIONS_PATH
#3663
Comments
I wonder if this is why molecule always reinstall the dependency even after I specify the environment variables. |
Could you help submit a PR to fix this issue? I can help review it.
Exactly. Many user complain that The order of |
I've only briefly looked at the code, and the parts that handle role/collection paths is indeed quite complex. I am not sure I'd be able to make a PR easily, but I can try to take a shot. |
Molecule calls
ansible-galaxy <role/collection> install ...
, but it doesn't pass along values for eitherANSIBLE_ROLES_PATH
orANSIBLE_COLLECTIONS_PATH
when doing so. As a result, roles/collections are always installed to~/.cache/ansible-compat/<hash>
.Furthermore, in molecule 4.0.0 (specifically in #3514), the behavior was also changed to insert this cache dir ahead of any other entries. As such, when molecule runs, it looks something like this:
This behavior causes trouble on our CI systems where we have a separate partition for caches and build all projects under the same directory name (
/jenkins/workspace
), which always hashes to the same value. We could possibly work around the first issue by callingansible-galaxy ... install
manually, but molecule doesn't look at data in these custom paths, so it doesn't work.The text was updated successfully, but these errors were encountered: