I agree with the responses in there. Besides in the tasks, there's a readme file and other ways to have this information.
On Mon, Aug 13, 2018 at 11:09 AM 'J Hawkesworth' via Ansible Project < [email protected]> wrote: > Nothing implemented I believe, but see the discussion here: > > https://github.com/ansible/proposals/issues/19 > > Jon > > On Monday, August 13, 2018 at 1:04:17 PM UTC+1, [email protected] wrote: >> >> Short question: >> >> Is it possible for me to leverage whatever-it-is that makes ansible-doc work >> for my own playbooks? >> >> Long drawn-out question: >> >> So I'm fairly new to ansible. I'm much more used to writing shell >> scripts and/or perl scripts. Both bash and perl have a way to create a >> -h and/or --help flag that will generate documentation instead of >> actually running the script. Perl goes even further with "pod" which has a >> program to display man-page-esque information. >> >> Does ansible-playbook have anything similar? The closest I've been able >> to figure out is something like this: >> >> tasks: >> - name: Help message >> block: >> - pause: >> prompt: |- >> This is a Literal Block Scalar. >> It will display the text >> exactly >> as it appears here with newlines >> and extra spaces. I can use an optional minus sign to >> prevent a final newline. >> >> Hit Return to continue >> - fail: >> msg: "Aborting after requesting help" >> when: help is defined >> - debug: >> msg: "\n\nHi There from {{inventory_hostname}}\n\n" >> >> >> >> This works ... but it's a little clunky. I have to remember to call it >> >> ansible-playbook -e help=1 playbook.yaml >> >> But I would **love** to be able to run >> >> ansible-doc playbook.yaml >> >> and have it either generate documentation (that I would, of course, >> write) or generate an error that no documentation is available. >> >> Is this possible? >> >> --EbH >> > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/6d47bd89-25df-4d62-8998-ff55474206be%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/6d47bd89-25df-4d62-8998-ff55474206be%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Jonathan lozada de la matta AUTOMATION CONSULTANT - AUTOMATION PRACTICE Red Hat Consulting Services <https://www.redhat.com/> [email protected] -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFYJA%2BKVFv1RwKBR-1STLxOaOpu7OE8Sdwm1kJWP052S9i6DGw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
