2017-09-23 03:19:50 +00:00
.. contents :: Topics
2018-07-05 21:30:46 +00:00
.. _inventory_plugins:
2017-09-23 03:19:50 +00:00
Inventory Plugins
-----------------
2018-03-15 08:23:34 +00:00
Inventory plugins allow users to point at data sources to compile the inventory of hosts that Ansible uses to target tasks, either via the `` -i /path/to/file `` and/or `` -i 'host1, host2' `` command line parameters or from other configuration sources.
2017-09-23 03:19:50 +00:00
2017-10-11 04:15:25 +00:00
.. _enabling_inventory:
2017-09-23 03:19:50 +00:00
Enabling Inventory Plugins
++++++++++++++++++++++++++
Most inventory plugins shipped with Ansible are disabled by default and need to be whitelisted in your
2018-04-20 00:02:30 +00:00
:ref: `ansible.cfg <ansible_configuration_settings>` file in order to function. This is how the default whitelist looks in the
2017-09-25 22:37:33 +00:00
config file that ships with Ansible:
2017-09-23 03:19:50 +00:00
.. code-block :: ini
[inventory]
enable_plugins = host_list, script, yaml, ini
2017-09-25 22:37:33 +00:00
This list also establishes the order in which each plugin tries to parse an inventory source. Any plugins left out of the list will not be considered, so you can 'optimize' your inventory loading by minimizing it to what you actually use. For example:
2017-09-23 03:19:50 +00:00
.. code-block :: ini
[inventory]
enable_plugins = advanced_host_list, constructed, yaml
2017-10-11 04:15:25 +00:00
.. _using_inventory:
Using Inventory Plugins
+++++++++++++++++++++++
The only requirement for using an inventory plugin after it is enabled is to provide an inventory source to parse.
Ansible will try to use the list of enabled inventory plugins, in order, against each inventory source provided.
Once an inventory plugin succeeds at parsing a source, the any remaining inventory plugins will be skipped for that source.
.. _inventory_plugin_list:
2017-09-23 03:19:50 +00:00
Plugin List
+++++++++++
2017-09-25 22:37:33 +00:00
You can use `` ansible-doc -t inventory -l `` to see the list of available plugins.
Use `` ansible-doc -t inventory <plugin name> `` to see plugin-specific documentation and examples.
2017-09-23 03:19:50 +00:00
.. toctree :: :maxdepth: 1
:glob:
inventory/*
.. seealso ::
2018-04-20 00:02:30 +00:00
:ref: `about_playbooks`
2017-09-23 03:19:50 +00:00
An introduction to playbooks
:doc: `callback`
Ansible callback plugins
:doc: `connection`
Ansible connection plugins
2018-04-20 00:02:30 +00:00
:ref: `playbooks_filters`
2017-09-23 03:19:50 +00:00
Jinja2 filter plugins
2018-04-20 00:02:30 +00:00
:ref: `playbooks_tests`
2017-09-23 03:19:50 +00:00
Jinja2 test plugins
2018-04-20 00:02:30 +00:00
:ref: `playbooks_lookups`
2017-09-23 03:19:50 +00:00
Jinja2 lookup plugins
:doc: `vars`
Ansible vars plugins
`User Mailing List <http://groups.google.com/group/ansible-devel> `_
Have a question? Stop by the google group!
`irc.freenode.net <http://irc.freenode.net> `_
#ansible IRC chat channel