Create the first account without gui

Hello there,
I would like to automatize the recovering of my homelab so I wish to handle the creation of tmy admin account to Ansible, is there any possibility to provide the credentials through the docker configuration? Or maybe with using API ? Moreover, it will be handsome if I can automatize the import of my vault secrets directly through Ansible.

Thanks to anyone who can help with theses questions.

I’m not sure if this is possible but I am also unsure that I understand what you are trying to do

  • What do you mean by automatizing the recovering of your homelab? Do you mean Vaultwarden or another service?
  • What admin account to you want to create?
  • And what secrets do you want to import? Do you mean to import a Bitwarden json backup in a newly created account? Or do you mean something different?

Personally I’d recommend creating and restoring a backup of the persistent data instead of using ansible as disaster recovery tool:

If that’s not what you want you could checkout the Bitwarden CLI if it helps (I don’t think that it supports creating accounts though), but if your objective is not about recovering Vaultwarden but actually using the secrets from Vaultwarden it could be that you actually want the capabilities of the Secrets Manager (which we don’t support because its code not licensed under a free and open source license).

Thank you for you’re reply,
I would like to automatize the deployment of my homelab (and maybe use this automation as a recover)

  1. I want to create playbooks to be able to deploy from scratch all my services (including Vaultwarden) and recover some backup files.
  2. I use vaultwarden with only one account admin, I would like to create this account using ansible.
  3. Import a Json Backup

I’ll check the link you mentioned, this could help me to accomplish my goal.

thank you!

Thank you @stefan0xC , I’ve just followed yours recommendations and its perfect for my use case.
I’ve created a daily cron to backup my conf.

I’ve got all my data and can easily restore it through my ansible playbook.