mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
add toggle to controle inventory parse as error (#28729)
* add toggle to controle inventory parse as error also rearranged new inventory options into it's own ini section * updated with inventory features also minor fixes/consolidation on deprecated/removed modules * tweaked settings
This commit is contained in:
parent
862cde5e82
commit
de6ba4daff
4 changed files with 56 additions and 30 deletions
|
@ -267,9 +267,17 @@ class InventoryManager(object):
|
|||
else:
|
||||
if not parsed and failures:
|
||||
# only if no plugin processed files should we show errors.
|
||||
for fail in failures:
|
||||
display.warning('\n* Failed to parse %s with %s plugin: %s' % (to_native(fail['src']), fail['plugin'], to_native(fail['exc'])))
|
||||
display.vvv(fail['exc'].tb)
|
||||
if C.INVENTORY_UNPARSED_IS_FAILED:
|
||||
msg = "Could not parse inventory source %s with availabel plugins:\n" % source
|
||||
for fail in failures:
|
||||
msg += 'Plugin %s failed: %s\n' % (fail['plugin'], to_native(fail['exc']))
|
||||
if display.verbosity >= 3:
|
||||
msg += "%s\n" % fail['exc'].tb
|
||||
raise AnsibleParserError(msg)
|
||||
else:
|
||||
for fail in failures:
|
||||
display.warning('\n* Failed to parse %s with %s plugin: %s' % (to_native(fail['src']), fail['plugin'], to_native(fail['exc'])))
|
||||
display.vvv(fail['exc'].tb)
|
||||
|
||||
if not parsed:
|
||||
display.warning("Unable to parse %s as an inventory source" % to_native(source))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue