-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
vars_files
depending on host vars no longer fails as of 2.15 with error_on_undefined_vars
disabled
#80483
Labels
affects_2.16
affects_2.18
bug
This issue/PR relates to a bug.
data_tagging
has_pr
This issue has an associated PR.
Comments
Files identified in the description: If these files are incorrect, please update the |
ansibot
added
affects_2.15
bug
This issue/PR relates to a bug.
needs_triage
Needs a first human triage before being processed.
labels
Apr 11, 2023
So I guess to extend this, a few options:
|
This comment was marked as outdated.
This comment was marked as outdated.
bcoca
removed
the
needs_triage
Needs a first human triage before being processed.
label
Apr 13, 2023
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects_2.16
affects_2.18
bug
This issue/PR relates to a bug.
data_tagging
has_pr
This issue has an associated PR.
Summary
As of #80171
VariableManager.get_vars
is no longer responsible for calculatingdelegated_vars
, and instead that is deferred to theTaskExecutor
to callVariableManager.get_delegated_vars_and_hostname
explicitly. As a resultinclude_delegate_to
changed it's default toFalse
since it no longer handles this functionality.However, when loading
vars_files
we have some logic that made a potential non-exact determination that the failure could be related to not having a host or needing a delegated host:ansible/lib/ansible/vars/manager.py
Lines 370 to 373 in 6221109
I'm pretty sure that logic wasn't capable of making the real determination anyway that the missing var was due to missing host vars or facts, and it seems to have been more a guess.
As a result, we never fail, regardless of
error_on_undefined_vars
being disabled.This code is also suspect, and I don't think capable of making a proper determination of whether it was host vars vs facts, or anything else pretty much:
ansible/lib/ansible/vars/manager.py
Lines 374 to 377 in 6221109
Honestly, I'm kind of sad I went looking for this, I've waffled about ignoring it, but the fact that we have code that I don't think is actually capable of doing what it was intended to do bothers me.
Maybe we just always allow it to skip (with a message), and never make it an error, and allow the fact that any vars from that file would be missing, and would cause a failure later. Also, for the record I'm also advocating that we deprecate and remove
DEFAULT_UNDEFINED_VAR_BEHAVIOR
.Issue Type
Bug Report
Component Name
lib/ansible/vars/manager.py
Ansible Version
Configuration
OS / Environment
N/A
Steps to Reproduce
Expected Results
Actual Results
No failure, and no indication of skipping loading the file.
Code of Conduct
The text was updated successfully, but these errors were encountered: