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
Support ANSIBLE_COLLECTIONS_PATH environment var #3681
Conversation
Hi @nre-ableton Thanks for your work. IMHO, even if you extend the collection paths, the molecule will also install dependencies into ~/.cache/ansible-compat/hash-vaule/, which is an isolated cache path defined in ansible-compat package. You can find more details in ansible-compat package. Are you sure the test result is correct? |
@zhan9san Yes, molecule behaves the same with roles. I wish that molecule had proper offline support, but that is a separate discussion (see ansible/galaxy#2030). For this to work, |
I wonder if we can introduce an ---
dependency:
name: galaxy
offline: true
role-file: requirements.yml
requirements-file: collections.yml Please allow me to explain it in detail. Internet accessCurrently, there are two kinds of dependencies need to be downloaded from internet when run
Installation locationAssume the my role name is For the 1st, the dependencies will be installed by For the 2nd, the dependencies for scenario test will be installed by Then, the installed location would be as below.
Unified locationAs we can see, there are many different locations. If we install them in one unified location, and ensure Let me know what you think. |
@zhan9san I think that this would be a great idea, and I wouldn't mind to implement something like this. Offline mode would be very useful for us. However, I also think that it is a bit beyond the scope of this PR. 😁 I'll go ahead and un-draft this PR, unless you have any strong objections. |
LGTM. |
This commit adds supports for reading ANSIBLE_COLLECTIONS_PATH from the environment, in a similar manner to how ANSIBLE_ROLES_PATH is handled.
a7afb27
to
4070e8a
Compare
@zhan9san Thanks for the merge! |
This commit adds supports for reading ANSIBLE_COLLECTIONS_PATH from the environment, in a similar manner to how ANSIBLE_ROLES_PATH is handled.
This commit adds supports for reading ANSIBLE_COLLECTIONS_PATH from the environment, in a similar manner to how ANSIBLE_ROLES_PATH is handled.
—---
Fixes #3663