The ansible-doc command

The ansible-doc command has one function—to provide documentation for Ansible. It mostly covers the core Ansible modules, which you can find a full list of by running the following command:

$ ansible-doc --list

For information on a module, just run the command followed by the module name, for example:

$ ansible-doc raw

As you can see from the following output, the documentation is quite detailed:

If you just want to see how to use the example in your playbook, then you can use the following command:

$ ansible-doc --snippet raw

This will give you an idea of what your playbook should contain, as you can see from the following ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.