Closed joao-p-marques closed 3 years ago
Yikes.. this is unfortunately another instance of https://github.com/hvac/hvac/issues/644#issuecomment-777272158 and another case where our tests are severely lacking (there's no tests at all for userpass
auth it seems 🤦). The fix is going to be easy, I'll look at getting out another bugfix release soon.
Unfortunately I'll probably have to delay tests to get that out more quickly, so I'll create another issue to track that.
Thanks for reporting @joao-p-marques !
Looking through the hvac code, I can also see that this would have worked in the plugin using an older version of hvac, so if you want a very quick fix and don't mind downgrading, you can try that, I think any hvac version lower than 0.9.6 would do it (you should see a warning from this plugin in ansible about using a deprecated auth method if it's using the old one).
Ok, thanks for the pointer @briantist
I will try that for now and upgrade as soon as the fix is merged and released :+1:
Thank you @joao-p-marques , if you could confirm that works I would really appreciate it 🙏 , I don't have a userpass method set up anywhere to test right now
I am afraid I won't be able to test this today, but tomorrow first thing I will and report back here :+1:
Thanks a lot for the help!
@briantist I can confirm that it works as is with hvac
at version 0.9.5 :+1:
Also, I tried updating hvac
back to the latest version (0.10.8) and applying the fix from #68 locally and it also works :smiley:
@joao-p-marques 😍that's perfect, I was hoping you'd be able to try the PR too, thank you so much! I'm going to try to get this released while it's still business hours in Portugal, maybe you'll be able to update before the end of (your) day 🤞
@joao-p-marques :heart_eyes: that's perfect, I was hoping you'd be able to try the PR too, thank you so much! I'm going to try to get this released while it's still business hours in Portugal, maybe you'll be able to update before the end of (your) day :crossed_fingers:
Thanks a lot @briantist
Right now we are only using this in development and testing, so the local fix gets me going for now, but thanks for the quick response :+1:
Thank you so much for your help @joao-p-marques , version 1.1.3 is released:
Nice, thank your for the work and quick response!
SUMMARY
I can use the lookup plugin to login with a user token, but I can't login using a username and password.
ISSUE TYPE
COMPONENT NAME
hashi_vault
lookup plugin, possibly with the integration with thehvac
library.ANSIBLE VERSION
CONFIGURATION
(empty)
OS / ENVIRONMENT
Fedora 33, running a playbook against localhost (local connection)
STEPS TO REPRODUCE
I created a simple playbook just to test this case:
EXPECTED RESULTS
Both cases should work (retrieve secrets with a token and with a username/password pair)
ACTUAL RESULTS
The first command (with a token) works (proving my user has access to said secret and that its token is valid) The second command does not work, giving the following error:
cc @Yajo