Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-playbook INVENTORY_ANY_UNPARSED_IS_FAILED not working #71936

Closed
fweep opened this issue Sep 25, 2020 · 6 comments
Closed

ansible-playbook INVENTORY_ANY_UNPARSED_IS_FAILED not working #71936

fweep opened this issue Sep 25, 2020 · 6 comments
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. needs_info This issue requires further information. Please answer any outstanding questions. P3 Priority 3 - Approved, No Time Limitation python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@fweep
Copy link

fweep commented Sep 25, 2020

SUMMARY

The configuration option INVENTORY_ANY_UNPARSED_IS_FAILED appears to have no effect. I get a warning from ansible-playbook that it was unable to parse the inventory source, but no error.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

hosts

ANSIBLE VERSION
ansible 2.10.1
  config file = /Users/jim/src/example.com/ansible.cfg
  configured module search path = ['/Users/jim/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/jim/.virtualenvs/default/lib/python3.8/site-packages/ansible
  executable location = /Users/jim/.virtualenvs/default/bin/ansible
  python version = 3.8.5 (default, Jul 21 2020, 18:31:18) [Clang 11.0.3 (clang-1103.0.32.62)]

CONFIGURATION
DEFAULT_REMOTE_USER(/Users/jim/src/example.com/ansible.cfg) = root
HOST_KEY_CHECKING(/Users/jim/src/example.com/ansible.cfg) = False
INTERPRETER_PYTHON(/Users/jim/src/example.com/ansible.cfg) = python3
OS / ENVIRONMENT

N/A

STEPS TO REPRODUCE
ANSIBLE_INVENTORY_ANY_UNPARSED_IS_FAILED=1 ansible-playbook -i INVALID ansible/playbook.yml
EXPECTED RESULTS

I expect this to behave just like ANSIBLE_INVENTORY_UNPARSED_FAILED (which I'll note is asymmetrically-named as there is no IS).

ANSIBLE_INVENTORY_UNPARSED_FAILED=1 ansible-playbook -i INVALID ansible/playbook.yml

[WARNING]: Unable to parse /Users/jim/src/example.com/INVALID as an inventory source
ERROR! No inventory was parsed, please check your configuration and options.
ACTUAL RESULTS
[WARNING]: Unable to parse /Users/jim/src/example.com/INVALID as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does
not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: controller

PLAY [controller] ********************************************************************************************
skipping: no hosts matched

PLAY RECAP ***************************************************************************************************

It should fail here as well.

@ansibot
Copy link
Contributor

ansibot commented Sep 25, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 25, 2020
@sivel
Copy link
Member

sivel commented Sep 25, 2020

It seems that a missing inventory, is not the same thing as an inventory that cannot be parsed.

@s-hertel
Copy link
Contributor

It looks like INVENTORY_ANY_UNPARSED_IS_FAILED only works if a plugin fails while parsing it (and not when all plugins rejects the source before trying to parse it). I think this line should be changed to if not parsed:.

@samdoran samdoran added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Sep 29, 2020
@Akasurde
Copy link
Member

@fweep Could you please check if PR #73160 works for you?

It works for me -

# ANSIBLE_INVENTORY_ANY_UNPARSED_IS_FAILED=1 ansible-playbook -i INVALID debug.yml
[WARNING]:  * Failed to parse /Volumes/data/src/playbooks/INVALID with yaml plugin: Plugin
configuration YAML file, not YAML inventory
[WARNING]:  * Failed to parse /Volumes/data/src/playbooks/INVALID with ini plugin: Invalid
host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to
provide a port.
ERROR! Completely failed to parse inventory source /Volumes/data/src/playbooks/INVALID

needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label May 22, 2021
@ansibot
Copy link
Contributor

ansibot commented Jun 23, 2021

@fweep This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jul 25, 2021

@fweep You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

@ansibot ansibot closed this as completed Jul 25, 2021
@ansible ansible locked and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. needs_info This issue requires further information. Please answer any outstanding questions. P3 Priority 3 - Approved, No Time Limitation python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

6 participants