Skip to content
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

Compatibility between rbw and Ansible plugin community.general.bitwarden #208

Open
ced455 opened this issue Oct 4, 2024 · 3 comments
Open

Comments

@ced455
Copy link

ced455 commented Oct 4, 2024

Hello,

I am currently using the Ansible plugin community.general.bitwarden, which interacts with Bitwarden CLI to manage secrets in my automation tasks. I have recently discovered rbw as an alternative implementation of the Bitwarden CLI and was impressed by its performances !.

I would like to know if there is any way to use rbw with the Ansible plugin community.general.bitwarden instead of the official Bitwarden CLI. Specifically:

Are there any plans to support rbw within Ansible’s Bitwarden module?
If not, are there potential workarounds or custom integrations I could apply to make rbw compatible with the Ansible plugin?

Thank you for your time and for the fantastic work on rbw!

@lalmeras
Copy link

lalmeras commented Oct 5, 2024

There are basically two ways to go to use rbw with ansible :

  • As ansible plugin uses bw command, implement a fake bw command that calls rbw. As bw and rbw commands contracts are slightly different, it may be tedious to implement. The advantage would be a seamless switch from bitwarden to rbw client by switching bw command.
  • Rewrite bitwarden ansible plugin to create an rbw ansible plugin, and adapt lookup arguments to match rbw usage. As ansible plugin is compact, it is an easy work.

Here is a basic demo implementation : https://github.com/lalmeras/rbw-ansible/blob/main/README.md

Here is the changes from bitwarden plugin :

  • no search argument : plugin currently uses rbw get and so matching is done on uuid / uri / name ; may be implemented by using rbw search or rbw list and post filtering
  • no collection_id, organization_id argument : not sure I miss something, but it seems that rbw does not expose collection/organization, either for selection or in outputs
  • raw output of rbw is not the same than bw ;
    • if field argument is used, output should be the same than bw
    • if no field is provided, pay attention that json structure is different (for example login.username is data.username with rbw)

If you do not use the missing argument and use field argument, just changing the lookup module name should be necessary to perform the switch.

I'm interested by feedback on the subject. As I'm an happy user of both ansible and rbw, I think i may work further on this plugin.

@ced455
Copy link
Author

ced455 commented Oct 6, 2024

Hi @lalmeras this look terrific !
I will try this next week :)

@ced455
Copy link
Author

ced455 commented Nov 20, 2024

Hello again @lalmeras
I just tried it on one of my largest playbooks, and it's blazing fast!
It supports all the parameters I was using, so it's truly plug-and-play, at least for me. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants