-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Add ok_if_missing option to passwordstore lookup (#28702) #28908
Conversation
Noticing there's no integration test for passwordstore. I'm not familiar with the passwordstore tool beyond what I've done with this PR. If someone would like to add tests, that'd be great. If not, I can add it to my backlog. |
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.
Docs OK with a minor edit. Needs core team tech review before merge. Thanks @nrwahl2!
@dharmabumstead : Thanks! I had used "Return" rather than "Returns" to maintain consistency with existing documentation, as well as PEP-257 recommendations on docstrings (which, granted, this is not): Existing doc:
PEP-257 recommendation:
|
@nrwahl2 you are correct, and I was in a hurry. Changed both instances to just 'return' instead of 'returns'. Thanks. |
@nrwahl2 Could you please rebase so that we can make it to 2.5 release? |
Is this making it into 2.5? |
i created similar toggle, but general to all lookups #35932 |
Closing this one. Feel free to rebase and reopen. |
SUMMARY
Add ok_if_missing option to passwordstore lookup (#28702)
There is currently no way to default to another value if the password is not found. This PR adds an
ok_if_missing
option (defaultFalse
). When set toTrue
, it causes a missing password in a passwordstore lookup to return aFalse
value rather than failing. This allows a playbook to use a Jinja2 default value easily.Side note: I was reading through the documentation, and it's not clear to me what these two pieces mean. We should clarify them.
ISSUE TYPE
COMPONENT NAME
plugins/lookups/passwordstore
ANSIBLE VERSION
ADDITIONAL INFORMATION
Test cases: