2023-08-27 11:43:02 +02:00
|
|
|
---
|
|
|
|
- name: Download the latest release
|
|
|
|
ansible.builtin.unarchive:
|
2023-08-28 22:10:37 +02:00
|
|
|
src: https://vault.bitwarden.com/download/?app=cli&platform=linux
|
2023-08-27 11:43:02 +02:00
|
|
|
dest: ~/.local/bin/
|
|
|
|
remote_src: yes
|
|
|
|
creates: ~/.local/bin/bw
|
|
|
|
|
|
|
|
- name: Make it executable
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: ~/.local/bin/bw
|
|
|
|
mode: u+x
|
|
|
|
|
|
|
|
- name: Run the CLI to create initial file
|
|
|
|
ansible.builtin.command:
|
2023-08-28 22:10:37 +02:00
|
|
|
# See https://github.com/bitwarden/clients/issues/6144
|
|
|
|
cmd: "~/.local/bin/bw --version"
|
2023-08-27 11:43:02 +02:00
|
|
|
creates: ~/.config/Bitwarden CLI/data.json
|
|
|
|
|
|
|
|
- name: Create data stores for specific deployments
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: ~/.config/Bitwarden CLI/data.json
|
|
|
|
dest: ~/.config/Bitwarden CLI/{{ item }}.json
|
|
|
|
mode: 0600
|
|
|
|
force: false
|
|
|
|
remote_src: true
|
|
|
|
loop:
|
|
|
|
- vault.bitwarden.com
|
|
|
|
- vault.mfocko.xyz
|
|
|
|
|
|
|
|
- name: Symlink to the self-hosted deployment
|
|
|
|
ansible.builtin.file:
|
|
|
|
src: ~/.config/Bitwarden CLI/vault.mfocko.xyz.json
|
|
|
|
path: ~/.config/Bitwarden CLI/data.json
|
|
|
|
force: true
|
|
|
|
state: link
|
|
|
|
# - name: Switch the server on the self-hosted “login”
|
|
|
|
# ansible.builtin.command:
|
|
|
|
# cmd: bw config server https://vault.mfocko.xyz
|