2021-02-21 19:50:07 +00:00
|
|
|
---
|
2019-04-10 12:46:47 +00:00
|
|
|
- name: Create Bitwarden Directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2021-11-11 15:14:06 +00:00
|
|
|
mode: '0755'
|
2019-04-10 12:46:47 +00:00
|
|
|
with_items:
|
|
|
|
- "{{ bitwarden_data_directory }}"
|
|
|
|
|
|
|
|
- name: Bitwarden Docker Container
|
|
|
|
docker_container:
|
|
|
|
name: bitwarden
|
2020-04-26 03:27:37 +00:00
|
|
|
image: bitwardenrs/server:latest
|
2019-04-10 12:46:47 +00:00
|
|
|
pull: true
|
|
|
|
ports:
|
2020-01-05 21:47:40 +00:00
|
|
|
- "{{ bitwarden_port_a }}:80"
|
|
|
|
- "{{ bitwarden_port_b }}:3012"
|
2019-04-10 12:46:47 +00:00
|
|
|
volumes:
|
|
|
|
- "{{ bitwarden_data_directory }}:/data:rw"
|
|
|
|
env:
|
2019-04-14 17:43:41 +00:00
|
|
|
SIGNUPS_ALLOWED: "{{ bitwarden_allow_signups }}"
|
2019-04-10 14:28:35 +00:00
|
|
|
ADMIN_TOKEN: "{{ bitwarden_admin_token }}"
|
2019-04-10 12:46:47 +00:00
|
|
|
LOG_FILE: "/data/bitwarden.log"
|
2019-04-14 15:45:48 +00:00
|
|
|
WEBSOCKET_ENABLED: "true"
|
2019-04-10 12:46:47 +00:00
|
|
|
labels:
|
2019-04-14 16:05:21 +00:00
|
|
|
traefik.enable: "{{ bitwarden_available_externally }}"
|
2021-04-07 17:37:55 +00:00
|
|
|
traefik.http.routers.bitwarden.rule: "Host(`{{ bitwarden_hostname }}.{{ ansible_nas_domain }}`)"
|
|
|
|
traefik.http.routers.bitwarden.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.bitwarden.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.bitwarden.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.bitwarden.service: "bitwarden"
|
2021-11-11 15:14:06 +00:00
|
|
|
traefik.http.routers.bitwarden.middlewares: "bitwarden-ipwhitelist@docker"
|
2021-04-07 17:37:55 +00:00
|
|
|
traefik.http.services.bitwarden.loadbalancer.server.port: "80"
|
|
|
|
traefik.http.routers.bitwarden-ws.rule: "Host(`{{ bitwarden_hostname }}.{{ ansible_nas_domain }}`) && Path(`/notifications/hub`)"
|
|
|
|
traefik.http.routers.bitwarden-ws.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.bitwarden-ws.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.bitwarden-ws.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.bitwarden-ws.service: "bitwarden-ws"
|
2021-11-11 15:14:06 +00:00
|
|
|
traefik.http.routers.bitwarden-ws.middlewares: "bitwarden-ipwhitelist@docker"
|
2021-04-07 17:37:55 +00:00
|
|
|
traefik.http.services.bitwarden-ws.loadbalancer.server.port: "3012"
|
2021-11-11 15:14:06 +00:00
|
|
|
traefik.http.middlewares.bitwarden-ipwhitelist.ipwhitelist.sourcerange: "{{ bitwarden_ip_whitelist }}"
|
2021-02-23 15:16:29 +00:00
|
|
|
memory: "{{ bitwarden_memory }}"
|
2019-04-10 12:46:47 +00:00
|
|
|
restart_policy: unless-stopped
|
|
|
|
|
|
|
|
- name: Bitwarden Backup Container
|
|
|
|
docker_container:
|
|
|
|
name: bitwarden-backup
|
|
|
|
image: bruceforce/bw_backup:latest
|
|
|
|
pull: true
|
|
|
|
restart_policy: unless-stopped
|
2019-04-10 20:55:14 +00:00
|
|
|
volumes_from: bitwarden
|
2021-02-23 15:16:29 +00:00
|
|
|
memory: "{{ bitwarden_backup_memory }}"
|