Closed saulrh closed 3 years ago
👍 did similar patch on my side https://github.com/skeetmtp/ansible-modules-bitwarden/commit/14a9c0cf8f25702aa018bd6d0c72a58e27ada296
I tried this change using the custom_field=true flag, I'm still seeing an error although the error is different
fatal: [hostname]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ lookup('bitwarden', 'ansible-secrets', field='my_custom_field', custom_field=true) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'bitwarden'. Error was a <class 'StopIteration'>, original message: "}
I use custom_field too and got no issues with my similar patch.
I tried this change using the custom_field=true flag, I'm still seeing an error although the error is different
fatal: [hostname]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ lookup('bitwarden', 'ansible-secrets', field='my_custom_field', custom_field=true) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'bitwarden'. Error was a <class 'StopIteration'>, original message: "}
I use custom_field too and got no issues with my similar patch.
Huh... I tried it on one machine yesterday and got an error, tried it on another machine today and it worked
I'll do more investigating
Verified that this patch fixes issue mentioned in #14; tested on:
20.04
2.9.6
1.15.1
Would you please merge this fix? I can't deploy anything since weeks :-(
Apologies for the delay. Thank you so much for fixing this!
The bw cli program recently changed so that running
bw
without any arguments returned a failing status, causingsubprocess
to raise aCalledProcessError
that resulted in the lookup module failing. Invoking the program with a no-op argument like--version
causes it to exit successfully, which allows us to test for its presence.Fixes #14.