- In the previous lesson you have learned about filters.
In this lesson, we will cover plugins.
They are closely related and therefore,
before we get started, I want to give you an overview
of what exactly is used in which specific case.
So plugins are pieces of code
that increase Ansible core functionality.
There's a couple of default plugins
which I'm going to tell you about.
And custom plugins can be added easily.
If you want to use plugins,
you need to activate them in ansible.cfd
because it's additional code. It's not there by default.
A filter is a program that allows you to modify data.
We've talked about it in previous lesson
and that's something that doesn't require any activation
or whatsoever.
And filters are typically used to change variables
before using them.
So in plugins, there are different types.
There are filter plugins.
Filter plugins are plugins that are used to modify text.
Typically, is used in a variable.
And we've learned about that in the previous lesson.
There are cache plugins.
Cache plugins are plugins that allow caching of facts.
Inventory plugins are plugins that allow different types
of dynamic inventory to be used.
Lookup plugins is a very wide range
of plugins that allows fetching data externally.
And there are callback plugins
which are plugins that are used
to collect usage information about Ansible.
And there is more.
If you want to check it out,
go have a look
at docs.ansible.com/ansible/latest/plugins/plugins.html
for the complete list.
So to get more information about your plugins,
use ansible.doc
- t help
which is giving help about the different types
that you can use.
And there you can see cache and callback
and
inventory
and lookup.
All of these are
specific kinds of plugins.
The thing is it's not listed really well,
but if you want to know more about the cache plugins,
well use ansible.doc
- t cache
- l
to list them.
And there you can see a couple of
cache plugins.
And if you're interested in callback,
well, ansible.doc -t callback -l
and you list all the different callback plugins.
You can see that there's quite a couple
of options regarding these callback plugins.
Let's go back.
What else do we have?
We have
the inventory plugins,
the lookup plugins.
As the last example, you know how it works.
Now, I'm going to show you the lookup plugins.
So ansible.doc -t lookup -l is showing
again, an impressive list of lookup plugins
that are available.
So if at any case you're looking for specific plugins,
it's always a good idea to start
with ansible.doc -t help.
And then on the specific type you use -l
to show what is available.