Skip to content
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

role argument spec: allow for examples, like with plugins #81734

Closed
1 task done
evgeni opened this issue Sep 20, 2023 · 11 comments · Fixed by #82671
Closed
1 task done

role argument spec: allow for examples, like with plugins #81734

evgeni opened this issue Sep 20, 2023 · 11 comments · Fixed by #82671
Labels
feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. waiting_on_contributor This would be accepted but there are no plans to actively work on it.

Comments

@evgeni
Copy link
Contributor

evgeni commented Sep 20, 2023

Summary

When writing documentation for plugins, one can use EXAMPLES to have a (yaml) block with common examples.

When it comes to role argument specs, there is no comparable feature (arguably, it's not part of the argument spec for plugins either…).

It would be cool if we Ansible would allow roles to have examples that can be rendered by ansible-doc and antsibull-doc

Issue Type

Feature Idea

Component Name

role

Additional Information

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot ansibot added feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. labels Sep 20, 2023
@ansibot
Copy link
Contributor

ansibot commented Sep 20, 2023

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

@evgeni evgeni changed the title role argument spec: allow for exa,ples, like with plugins role argument spec: allow for examples, like with plugins Sep 20, 2023
@ansibot ansibot added the has_pr This issue has an associated PR. label Sep 20, 2023
@mattclay mattclay removed the needs_triage Needs a first human triage before being processed. label Sep 21, 2023
@mattclay
Copy link
Member

@mattclay mattclay added the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Sep 21, 2023
@felixfontein
Copy link
Contributor

👍 for adding that.

Depending on the role a more extensive document would also be useful (something with sections and text between examples), but that's a bit too much IMO - ansible-doc shouldn't become an arbitrary documentation rendering engine.

@samccann
Copy link
Contributor

@felixfontein a role within a collection could probably do that already with the collection-level docs support we have now. But that doesn't help standalone roles...And I agree- too much for ansible-doc.

@evgeni
Copy link
Contributor Author

evgeni commented Sep 21, 2023

Can you point me at the collection level docs you're talking about?

@samccann
Copy link
Contributor

https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_structure.html#collections-doc-dir

Notice there is an unfortunate catch-22 - if you want docs like these in docs.ansible.com, you have to write in .rst in a specific directory. If you want docs like these on AutomationHub/GalaxyNG - you have to write in md in a different directory (my guess is it works on galaxyNG but I haven't poked around to verify that).

@evgeni
Copy link
Contributor Author

evgeni commented Sep 21, 2023

Ah right, but those would be really at the collection level, not part of the docs shown for a role in a collection (either via ansible-doc or antsibull-docs).

@samccann
Copy link
Contributor

correct

@felixfontein
Copy link
Contributor

ansible-core: #82671
ansible-lint: ansible/ansible-lint#4019
antsibull-docs: ansible-community/antsibull-docs#244

@ssbarnea
Copy link
Member

@evgeni Any updates on this?

@felixfontein
Copy link
Contributor

@ssbarnea this is waiting on the Core team, as PRs exists, but the PR for ansible-core needs to be merged first. Right now #82671 has no review and there's no indication whether it even has a chance to get merged eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. waiting_on_contributor This would be accepted but there are no plans to actively work on it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants