-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Documentation on requirements.yml is confusing or misleading #73347
Comments
Files identified in the description: If these files are incorrect, please update the |
The v1 format is not deprecated. The v2 requirements.yml format was introduced in 2.9, the ability to install both collections and roles from a single command was introduced in 2.10. |
To double check, please correct me if needed:
AFAIK galaxy-ng has zero support for bare roles and there are no plans to add it. To me it does not make sense, why to add so much complexity for a packaging format that presents no benefits over the newer collections one. I do understand that the v1 is not deprecated, but based on what I hear, is a matter of time until it will happen. I really doubt there is even one Ansible user that enjoys the idea that he needs to run install twice in order to install the deps. |
Sounds like you confuse environment and package (role or collection) dependencies. Collection dependencies are only specified in Another thing is The difference is the same as between |
Well, couldn't you also use a FQCN in a standalone role's deps and have the side-effect of a standalone role depending upon a collection and needing to manually install that too? A collection's roles should only depend on other roles in the collection or roles of its dependencies. A collection's dependencies are in the format {collection_identifier: version} in the MANIFEST.json/galaxy.yml and standalone roles are not supported. Collection dependencies are installed with the collection itself unless --no-deps is used. Standalone roles should depend on standalone roles, collections should depend on other collections. We should clarify this in the documentation.
for collections, but it isn't really a behavioral change |
I stumbled here while following the instructions Migrating a role to a collection. Based on the thread above, it sounds like role dependencies should not be in the galaxy.yml unless they are a collection? Error message when importing collection to galaxy is:
with the
Using ansible-2.10.6 ansible-base-2.10.5 |
Dependencies in a |
I realize that now, but I thought it was a good example of how the documentation around requirements.yml, meta/requirements.yml, meta/main.yml, galaxy.yml and dependency management in general between roles and collections is confusing. |
What is the appropriate dependency management solution for moving a standalone role to a collection if it has a dependency on another standalone role? It sounds like there isn't one? |
You are correct, there isn't one. Stand alone roles, and collections (as well as roles in collections) cannot depend on each other. Only collection<->collection, and standalone-role<->standalone-role. To get dep auto installation, both would have to be stand alone roles, or both would have to live in collections. Otherwise users are on their own to install the deps. |
Can this please be added to to documentation explicitely (or an apropriate error be added to the ansible-galaxy CLI) ? eg: check if there is a |
There is also another inconsistency. https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-roles-and-collections-from-the-same-requirements-yml-file says
At the same time https://docs.ansible.com/ansible/latest/user_guide/collections_using.html states
|
This comment has been minimized.
This comment has been minimized.
I do really hope we endup with a single galaxy command for installing both types of dependencies. It makes no sense to have two different commands for installing deps declared inside the same file. What if we add another dependency type? Are we going to add a 3rd command for those? PS. I know that this observation is bit outside the original issue, but is closely related to it. |
This comment has been minimized.
This comment has been minimized.
This commit 400475a added additional handling to enforce and provide friendly errors that
The I'm going to proceed with closing this. If you have further questions please stop by IRC or the mailing list:
|
SUMMARY
meta/requirements.yml
. We could assume they should, but that is not specified anywhere.Please clarify this documentation and assure that it answers these questions:
# v2 requirements format (ansible 2.x+)
ISSUE TYPE
COMPONENT NAME
documentation
ANSIBLE VERSION
The text was updated successfully, but these errors were encountered: