dotfiles/roles/user/secrets/bw/tasks/main.yml
Matej Focko 42aeacb47b
fix(secrets/bw): use correct variables
Signed-off-by: Matej Focko <me@mfocko.xyz>
2024-07-12 14:56:07 +02:00

37 lines
1 KiB
YAML

---
- name: Download the latest release
ansible.builtin.unarchive:
src: https://vault.bitwarden.com/download/?app=cli&platform=linux
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: Create directory for Bitwarden accounts
ansible.builtin.file:
path: "~/.config/Bitwarden CLI"
state: directory
mode: 0700
owner: "{{ target_user }}"
group: "{{ target_group }}"
- name: Create directories for public Bitwarden instance
ansible.builtin.file:
path: "~/.config/Bitwarden CLI/vault.bitwarden.com"
state: directory
mode: 0700
owner: "{{ target_user }}"
group: "{{ target_group }}"
- name: Create directory for the self-hosted Vaultwarden instance
ansible.builtin.file:
path: "~/.config/Bitwarden CLI/{{ vaultwarden_address }}"
state: directory
mode: 0700
owner: "{{ target_user }}"
group: "{{ target_group }}"
when: vaultwarden_address