- With as many as 3,000 different modules
having access to the appropriate documentation
is very important.
So let's talk about documentation a bit.
The module documentation is in ansible-doc
Ansible-doc in fact contains documentation
for more than just modules.
It has documentation for about everything.
You can use ansible-doc -l to show a list
of all of the modules and if you are on 2.10 or later,
add -t module before the -l.
And in order to figure out what you can do with a module,
use ansible-doc modulename.
That has all the documentation about all the arguments
that can be used with a specific module as well.
In particular, if you look at the examples section
that exists at the end of documentation
for each of the modules.
In that section, you will find
some common use examples of modules.
Let me show you.
So to start with, there is ansible-doc -t module -l
which is shown a list of all the different modules.
In recent 2.9 versions, the -t module option
is supported as well.
Just for your impression,
find WC showing 3,387 modules in total.
Now, if you wanna know what the module is all about,
then you type ansible-doc on let's say, aci_filter.
I have no idea what it is but that's just normal
with more than 3,000 modules being available.
But the good thing is that Ansible doc
will describe what it is.
So it starts with the name of the Python script behind it.
Behind all modules, there's a Python script
and here you can find the exact bat reference
for the Python script.
That's a short explanation and then we have a list
of all the different arguments, also known as options.
Notice that if an equals sign is used, like here,
equals filter and equals host and equals password,
these are mandatory options.
Also convenient is to see also section,
to see also sections providing information
about related modules.
And near the end of the documentation,
you will find the examples.
So this is a playbook code.
So you need to know that what we see here
are the arguments but it's written playbook cell.
We'll learn more about it in the next video,
but it's already good to know,
to see these different options in action.
You will find some information about return code
and much more as well and that is what you can get
out of Ansible-doc.
Ansible-doc is awesome.
So I can just recommend use it a lot.