mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2025-12-17 03:34:28 +00:00
bw
This commit is contained in:
33
roles/vaultwarden/tasks/main.yml
Normal file
33
roles/vaultwarden/tasks/main.yml
Normal file
@ -0,0 +1,33 @@
|
||||
- name: Instalar dependências (curl, unzip, jq)
|
||||
become: true
|
||||
apt:
|
||||
name:
|
||||
- curl
|
||||
- unzip
|
||||
- jq
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Instalar Bitwarden CLI
|
||||
become: true
|
||||
shell: |
|
||||
curl -L https://github.com/bitwarden/cli/releases/latest/download/bw-linux.zip -o bw.zip
|
||||
unzip bw.zip
|
||||
chmod +x bw
|
||||
mv bw /usr/local/bin/bw
|
||||
args:
|
||||
creates: /usr/local/bin/bw
|
||||
|
||||
- name: Fazer login no Bitwarden
|
||||
shell: bw login {{ bw_email }} --password {{ bw_password }}
|
||||
register: bw_login
|
||||
no_log: true
|
||||
|
||||
- name: Desbloquear cofre e guardar sessão
|
||||
shell: bw unlock --password {{ bw_password }} --raw
|
||||
register: bw_session
|
||||
no_log: true
|
||||
|
||||
- name: Exportar sessão para ambiente local
|
||||
shell: echo "export BW_SESSION={{ bw_session.stdout }}" >> /etc/profile.d/bw-session.sh
|
||||
become: true
|
||||
Reference in New Issue
Block a user