community.general/lib/ansible
Abhijit Menon-Sen 276358c885
Introduce inventory.any_unparsed_is_failed configuration setting (#41171)
In the process of building up the inventory by parsing each inventory
source with each available inventory plugin, there are three kinds of
possible errors (listed in order from earliest to latest):

1. One source could not be parsed by a particular plugin.
2. One source could not be parsed by any available plugin.
3. ALL sources could not be parsed by any available plugin.

The errors in (1) are a part of normal operation, e.g., the script
plugin is expected to fail to parse an ini-format source, and we will
ignore that error and try the next plugin. There is currently no way to
control this, and no known compelling use-case for a setting to control
it. This commit does not make any changes here.

We implement "any_unparsed_is_failed" to handle (2) above. If enabled,
this requires that every available source be parsed validly by at least
one plugin. In an inventory comprising a static hosts file and ec2.py,
this setting will cause a fatal error if ec2.py fails (a situation that
attracted only a warning earlier).

We clarify that the existing "unparsed_is_failed=true" setting causes a
fatal error only in (3) above, i.e., if NO inventory source could be
parsed. In other words, if there is ANY valid source in the inventory
(e.g., an ini-format static file), no combination of errors and the
setting will cause a fatal error.

If you want to execute your playbooks when your inventory is…

    (a) complete, use "any_unparsed_is_failed=true".
    (b) not empty, use "unparsed_is_failed=true".

The "unparsed_is_failed" setting should be renamed to
"all_unparsed_is_failed", but this commit does not do so.

Fixes #40512
Fixes #40996
2018-06-06 09:28:58 +05:30
..
cli Fix typo in the ansible-inventory --host error (#41142) 2018-06-05 20:03:27 +02:00
compat Enable wildcard import pylint (#35786) 2018-02-06 15:17:49 -08:00
config Introduce inventory.any_unparsed_is_failed configuration setting (#41171) 2018-06-06 09:28:58 +05:30
errors give hint to users when a file is not found 2018-04-10 17:19:03 -04:00
executor Honor ignore_errors when invoking the debugger, add config to disable this behavior (#39868) 2018-05-31 11:14:26 -04:00
galaxy Allow the galaxy client to fetch from a url in role version data (#39396) 2018-04-30 15:47:43 -05:00
inventory Introduce inventory.any_unparsed_is_failed configuration setting (#41171) 2018-06-06 09:28:58 +05:30
module_utils pin azure deps to exact versions 2018-06-05 18:50:48 -07:00
modules fix issue #41081 in azure_rm_securitygroup (#41123) 2018-06-06 05:41:29 +08:00
parsing Fix flag in debug message (#40753) 2018-06-01 13:48:22 -04:00
playbook Support 'apply' to apply attributes to included tasks - Impl 1 (#39236) 2018-05-31 12:08:38 -05:00
plugins Better error message if the template is not utf-8 encoded (#41030) 2018-06-05 19:07:11 -07:00
template Allow config to enable native jinja types (#32738) 2018-05-31 10:38:29 +02:00
utils Make admin_users only contain root and toor because admin is used for non-privileged accounts 2018-06-05 17:01:40 -07:00
vars minimize loading files/plugins 2018-04-10 17:22:31 -04:00
__init__.py
constants.py adds ansible-doc JSON plugin data dump 2018-06-04 17:20:33 -07:00
release.py update 2.7 codename 2018-05-31 15:46:07 -07:00