ansible/docs/docsite/rst/plugins/inventory.rst
Brian Coca 2ed46e04f4 more updates to plugin/config generation (#30787)
* fixed module generation

added missing lookup page
point to plugins when plugins
made modules singular
add display for verbose an debug messages
nicer templating, changed generation order for ref
corrected links
moved most of lookup docs to plugin section

* Copy edits
* Fixed typos
* Clarified wording
2017-10-11 00:15:25 -04:00

2.3 KiB

Topics

Inventory Plugins

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.

Enabling Inventory Plugins

Most inventory plugins shipped with Ansible are disabled by default and need to be whitelisted in your ansible.cfg <../config> file in order to function. This is how the default whitelist looks in the config file that ships with Ansible:

[inventory]
enable_plugins = host_list, script, yaml, ini

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:

[inventory]
enable_plugins = advanced_host_list, constructed, yaml

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.

Plugin List

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.

maxdepth

1

inventory/*

../playbooks

An introduction to playbooks

callback

Ansible callback plugins

connection

Ansible connection plugins

../playbooks_filters

Jinja2 filter plugins

../playbooks_tests

Jinja2 test plugins

../playbooks_lookups

Jinja2 lookup plugins

vars

Ansible vars plugins

User Mailing List

Have a question? Stop by the google group!

irc.freenode.net

#ansible IRC chat channel