Generate docs from ansible argspec

306 views
Skip to first unread message

ProfHase

unread,
Oct 18, 2021, 3:10:59 AM10/18/21
to Ansible Project

Is there any way to generate a markdown documentation from ansible role argument spec?

https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#role-argument-validation

I could not find anything in ansible-doc, the format itself suggests that there is a way


Thanks a lot

Felix Fontein

unread,
Oct 20, 2021, 9:58:07 AM10/20/21
to ansible...@googlegroups.com
Hi,
this doesn't really answer your question (as it's producing
ReStructured Text and not MarkDown), but antsibull-docs
(https://github.com/ansible-community/antsibull/) also supports roles
(with role argument specs) next to plugins and modules.

Cheers,
Felix


Brian Coca

unread,
Nov 2, 2022, 10:03:05 AM11/2/22
to Ansible Project
`ansible-doc -t role --json <rolename>` will dump the info in JSON format, you can then use that with almost any templating engine to create a markdown formatted file.

Reply all
Reply to author
Forward
0 new messages