c0sco / ansible-modules-bitwarden

Bitwarden integrations for Ansible
GNU General Public License v3.0
109 stars 45 forks source link

stderr capture prevents json decode #19

Open mchwalisz opened 3 years ago

mchwalisz commented 3 years ago

I'm using snap package of bw command. Apparently, because of that my output looks like:

bw lock
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Your vault is locked.

where the warning message is printed to stdout. Warning is printed for every command. This in turn prevents lookup plugin to properly decode json strings, cause it merged stdout and stderr. Giving the following error:

FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'bitwarden'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Error decoding Bitwarden status: Expecting value: line 1 column 1 (char 0)"}
b-reich commented 3 years ago

after this error bw cli forgets my client config...