-
Notifications
You must be signed in to change notification settings - Fork 20
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
questions regarding parsing of requirements and dict variables #589
Comments
I'm a bit confused by what exactly you try to achieve.
ansible-doctor does not parse any requirements.yml file, It's intended to be used for roles or collections. According to the docs, both don't include requirements.yml files. To link and document dependencies of roles you can add it to the meta file as described in the ansible roles docs. Dependencies from the meta file will be detected and documented automatically.
Not sure if I understand this question. The type of an Ansible variable doesn't matter for
The result looks like this: |
thank you for the answer, ansible-galaxy is picking up requirements.yml defined requirements from roles automatically and installs them aswell when you place a requirement.yml into the meta directory, its diffrent from dependencies since they are not rolled out automatically with that aproach, but can be delegated to within your roles flow of tasks with
for that to work i either need to put both roles into the requirements.yml of my playbooks, or, and that is what i am doing, put the php role into the requirements.yml of my apache role, and only tell my playbook it needs apache |
for the variable section, i would love if it would be possible to have doctor resolve nested / sublayers of dictionary variables. |
From reading the docs https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#dependencies both methods |
Sorry, this is IMO a bit out of scope. |
thats not correct, if you check a few paragraphs below (https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#using-meta-main-yml), it states:
whereas if you define dependency in meta/requirements.yml they are not executed automatically, just installed, so that they can be executed at a controlled point in the role. the main difference here i think is meta/main.yml dependencies are an ansible-core feature: whereas the meta/requirements.yml is "just" instructions for ansible-galaxy to make sure those dependencies listed there are installed if the role is pulled in through a playbooks requirements.yml via ansible-galaxy. the differing part is probably that the requirements.yml is only parsed by galaxy and ansible itself has no idea about it or its contents |
Thanks for the details, I think I understand your use case. Would you like to contribute the |
i am open to looking into contributing that feature, just gonna need some time to slice off my general schedules to poke around ;) |
No worries 🙂 if you have any question just let me know. |
i would try to create a custom template to get requirement roles documented in the readme.md aswell,
ansible galaxy works using a requirements.yml in the meta folder of a role with the following syntax:
any idea how one could archive that?
another question revolves around dictionary variables, and how to properly get doctor to detect them and document them.
currently its just this:
and doctor itself would also only detect the initial dict var, is there a way to have it split them out, and detect and document the keys in the dict as vars aswell?
The text was updated successfully, but these errors were encountered: