-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Introduce dig lookup argument fail_on_error #4973
Conversation
e481163
to
b9a6230
Compare
For the record, this behaviour was originally proposed in ansible/ansible#41192 and in ansible/ansible#41195 (at least that's the way I recall it). I am all for this change, and think we should, indeed, make |
shipit |
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Could you please add a changelog fragment? Thanks :)
Since the current behavior has been the default for a very long time, I would wait a bit before making it configurable and deprecating the old behavior, to give users at least some versions of this collection that are backwards compatible but do not yet spit out deprecation warnings. (I'm fine with announcing deprecation in the next major release, i.e. 6.0.0, and announcing the default value change for version 8.0.0. In fact the deprecation can already be merged in a follow-up, since by keeping it in |
with default False for backwards compatibility. Allows fail-fast behavior on lookup failures instead of returning strings and continuing.
with default False for backwards compatibility.
Allows fail-fast behavior on lookup failures instead of returning strings and continuing.
SUMMARY
I would like the dig lookup to offer the option to fail on lookup errors. Right now it just returns empty strings or something like 'NXDOMAIN' as string which is ugly because you notice quite late that something is wrong with your infrastructure because a dig lookup in some config template produced an unexpected result although your playbook run was clean.
ISSUE TYPE
COMPONENT NAME
dig lookup plugin
ADDITIONAL INFORMATION
IMHO this should be the default, but for backwards compatibility I've disabled it.