c0sco / ansible-modules-bitwarden

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

Filter by username #9

Open markusressel opened 4 years ago

markusressel commented 4 years ago

Hi there, really great module!

On some sites I have stored passwords in Bitwarden for multiple users (f.ex. root as well as markus). Is there a way to add some kind of filter to the lookup call in a template, to specify this? If not, would it be possible to add something like this, or can I do this using other ansible magic in a simple way?

Thx!

c0sco commented 4 years ago

What's been working for me is making sure each entry name is unique in bw. For example, SiteA (root) for the entry with the root username and SiteA (matt) for the entry with the matt username. Not the most glamorous way to do it, but it works, and doesn't break functionality elsewhere (like in browser extensions). Either way you have to specify which username you want at some point, whether it's in the name of the entry or through some sort of search command 🤷

markusressel commented 4 years ago

@c0sco thx for the response. I thought about including the username in the title, and that is probably how I will do it, but it requires two bitwarden entity fields to be synchronized manually (the name and the username field). I know, it is not that big of a hassle, but it is error prone and, well, redundant. Including some kind of filtering logic to this module could be of value imho (maybe also in other situations).

c0sco commented 4 years ago

Makes sense! Unfortunately I don't have much time these days to contribute to this project, but we can definitely keep this issue open in case someone else is able to come up with a good solution.