Vaultwarden: Add email support.

This commit is contained in:
Viyurz 2024-03-16 13:50:04 +01:00
parent 03cf2817a4
commit a0a7dfbaf6
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8
3 changed files with 15 additions and 4 deletions

View file

@ -3,13 +3,16 @@
path: "{{ vaultwarden_project_dir }}"
state: directory
- name: Template docker-compose.yaml to project directory
- name: Template docker-compose.yaml & .env to project directory
template:
src: docker-compose.yaml
dest: "{{ vaultwarden_project_dir }}/docker-compose.yaml"
src: "{{ item }}"
dest: "{{ vaultwarden_project_dir }}/{{ item }}"
owner: "{{ ansible_env['USER'] }}"
group: "{{ ansible_env['USER'] }}"
mode: '640'
loop:
- docker-compose.yaml
- .env
- name: "Create directory {{ volumes['vaultwarden_datadir'] }} with correct permissions"
file:

View file

@ -0,0 +1,2 @@
ADMIN_TOKEN='{{ vaultwarden_secrets["admin_token_hash"] }}'
SMTP_PASSWORD='{{ vaultwarden_secrets["smtp_password"] }}'

View file

@ -7,7 +7,13 @@ services:
environment:
- DOMAIN=https://vw.{{ domain }}
- SIGNUPS_ALLOWED=false
- ADMIN_TOKEN={{ vaultwarden_secrets['admin_token_hash'] | regex_replace('\$', '$$') }}
- ADMIN_TOKEN=${ADMIN_TOKEN}
- SMTP_HOST=mail.{{ domain }}
- SMTP_FROM=vaultwarden@{{ domain }}
- SMTP_PORT={{ ports['mailserver_smtps'] }}
- SMTP_SECURITY=force_tls
- SMTP_USERNAME={{ vaultwarden_secrets['smtp_username'] }}
- SMTP_PASSWORD=${SMTP_PASSWORD}
ports:
- 127.0.0.1:{{ ports['vaultwarden'] }}:80
volumes: