-
Notifications
You must be signed in to change notification settings - Fork 59
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
hashi_vault
lookup plugin behavior on option duplication
#349
Comments
Hi @vladislav-sharapov and welcome! This is one of many downsides of putting these options in the term string, something I don't recommend. The plugin also supports direct (I'll say, correct) specification of options; the term-string based way is kept for compatibility. But in this case since the secret path itself is meant to be the term string, this ends up not being very helpful in catching duplicates. This collection now has other content besides the Because I'm recommending the use of other content, I'm generally not making changes to the If you're interested in putting up a PR, the place to modify would be here: As a quick brainstorm of a fix, I'd probably check for key existence in the dict and then raise an exception if the key is already set. Just note that it would still be possible to provide duplicates in a way that doesn't/shouldn't fail: - hosts: localhost
gather_facts: false
tasks:
- debug:
msg: >-
{{ lookup('hashi_vault',
'secret=secret/data/test:secret1',
secret='secret/data/test:secret2',
url='http://127.0.0.1:8200/') }} This provides If you're interested in putting up a PR we have a Contributor guide that can help you get started. Don't hesitate to ask any additional questions as needed. |
Hello, @briantist! Thanks for such a detailed answer. I'll create a PR. |
SUMMARY
hashi_vault
lookup plugin allows defining option duplicates.ISSUE TYPE
COMPONENT NAME
hashi_vault
lookup pluginANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Requirements:
secret1: value1
,secret2: value2
.VAULT_TOKEN
.EXPECTED RESULTS
Option duplication error.
ACTUAL RESULTS
Plugin returns second secret value.
The text was updated successfully, but these errors were encountered: