-
Notifications
You must be signed in to change notification settings - Fork 65
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 - Fix regression where VAULT_ADDR is ignored #61
Conversation
Codecov Report
@@ Coverage Diff @@
## main #61 +/- ##
==========================================
+ Coverage 66.58% 68.23% +1.64%
==========================================
Files 9 9
Lines 425 447 +22
Branches 58 60 +2
==========================================
+ Hits 283 305 +22
Misses 126 126
Partials 16 16
Continue to review full report at Codecov.
|
f2555cc
to
2fd77d1
Compare
2fd77d1
to
c7d4672
Compare
Link to the failed test correctly catching the problem: |
SUMMARY
Fixes #60
Related:
When lowering the precedence of the
VAULT_ADDR
env var, I failed to take into account that the default value in the option itself would prevent the low pref env var value from ever being used, as implemented.This would affect any option that has both a default value and a "low preference env var", which at the moment only applies to
url
/VAULT_ADDR
.This PR fixes that.
First, a unit test catching this is being added, then I will push a commit with the fix.
Note: the unit test only covers this option specifically and could be expanded. This work is actually already in progress in #59 , and I would have surfaced this eventually because of that. I'm keeping this small for this bugfix, but better tests will absolutely be introduced via the refactor.
Affected Users
This bug will have affected version 1.0.0 and 1.1.0, since the env var priority change was released in 1.0.0 via #41 .
Fix Available
Version 1.1.1 of the collection contains this fix:
Workarounds
If upgrading is not possible, the best workaround if you can is to switch to using
ANSIBLE_HASHI_VAULT_ADDR
or to set the address viaansible.cfg
:If neither of those are possible, setting
url
explicitly on the plugin call can be done and the value can be read via the env lookup:ISSUE TYPE
COMPONENT NAME
hashi_vault.py
ADDITIONAL INFORMATION