Inventory plugins move auto before ini (#44428)

* inventory plugins: try auto before ini

auto plugin should run before ini to avoid ini being able to parse
some plugin configuration YAML files successfully.

* Update comment

comment was added by 2ffe3c42bb but
related code was later removed by
506e6a0b2d.
This commit is contained in:
Pilou 2018-12-11 21:17:05 +01:00 committed by ansibot
parent 7af405883f
commit 1bad617f29
4 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ config file that ships with Ansible:
.. code-block:: ini .. code-block:: ini
[inventory] [inventory]
enable_plugins = host_list, script, yaml, ini, auto enable_plugins = host_list, script, auto, 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: 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:

View file

@ -324,7 +324,7 @@
#any_errors_fatal = False #any_errors_fatal = False
[inventory] [inventory]
# enable inventory plugins, default: 'host_list', 'script', 'yaml', 'ini', 'auto' # enable inventory plugins, default: 'host_list', 'script', 'auto', 'yaml', 'ini'
#enable_plugins = host_list, virtualbox, yaml, constructed #enable_plugins = host_list, virtualbox, yaml, constructed
# ignore these extensions when parsing a directory as inventory source # ignore these extensions when parsing a directory as inventory source

View file

@ -1442,7 +1442,7 @@ INVENTORY_CACHE_TIMEOUT:
- {key: cache_timeout, section: inventory} - {key: cache_timeout, section: inventory}
INVENTORY_ENABLED: INVENTORY_ENABLED:
name: Active Inventory plugins name: Active Inventory plugins
default: ['host_list', 'script', 'yaml', 'ini', 'toml', 'auto'] default: ['host_list', 'script', 'auto', 'yaml', 'ini', 'toml']
description: List of enabled inventory plugins, it also determines the order in which they are used. description: List of enabled inventory plugins, it also determines the order in which they are used.
env: [{name: ANSIBLE_INVENTORY_ENABLED}] env: [{name: ANSIBLE_INVENTORY_ENABLED}]
ini: ini:

View file

@ -263,7 +263,7 @@ class InventoryManager(object):
if plugin_wants: if plugin_wants:
try: try:
# in case plugin fails 1/2 way we dont want partial inventory # FIXME in case plugin fails 1/2 way we have partial inventory
plugin.parse(self._inventory, self._loader, source, cache=cache) plugin.parse(self._inventory, self._loader, source, cache=cache)
parsed = True parsed = True
display.vvv('Parsed %s inventory source with %s plugin' % (source, plugin_name)) display.vvv('Parsed %s inventory source with %s plugin' % (source, plugin_name))