Add auto-backup in HOME_ASSISTANT, MATRIX, N8N, PROTONMAIL
This commit is contained in:
parent
c925c6793e
commit
221b1f8b6a
8 changed files with 187 additions and 24 deletions
|
@ -1,18 +0,0 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
protonmail-bridge:
|
||||
image: shenxn/protonmail-bridge
|
||||
restart: always
|
||||
container_name: protonmail-bridge
|
||||
networks:
|
||||
- protonmail
|
||||
volumes:
|
||||
- protonmail:/root
|
||||
|
||||
volumes:
|
||||
protonmail:
|
||||
|
||||
networks:
|
||||
protonmail:
|
||||
external: true
|
|
@ -12,6 +12,15 @@
|
|||
dest: protonmail/
|
||||
register: protonmail_copy_files_results
|
||||
|
||||
- name: Copy template conf
|
||||
ansible.builtin.template:
|
||||
backup: true
|
||||
src: "{{ item.src }}"
|
||||
dest: "protonmail/{{ item.dest }}"
|
||||
loop:
|
||||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: protonmail_copy_templates_results
|
||||
|
||||
- name: Create protonmail network
|
||||
community.docker.docker_network:
|
||||
name: protonmail
|
||||
|
@ -29,7 +38,7 @@
|
|||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: protonmail.initialized and protonmail_copy_files_results.changed
|
||||
when: protonmail.initialized and (protonmail_copy_templates_results.changed or protonmail_copy_files_results.changed)
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
|
@ -37,5 +46,5 @@
|
|||
project_src: protonmail
|
||||
state: present
|
||||
pull: true
|
||||
when: protonmail.initialized and not protonmail_copy_files_results.changed
|
||||
when: protonmail.initialized and not protonmail_copy_templates_results.changed and not protonmail_copy_files_results.changed
|
||||
become: true
|
31
roles/protonmail/templates/docker-compose.yml.j2
Normal file
31
roles/protonmail/templates/docker-compose.yml.j2
Normal file
|
@ -0,0 +1,31 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
protonmail-bridge:
|
||||
image: shenxn/protonmail-bridge
|
||||
restart: always
|
||||
container_name: protonmail-bridge
|
||||
networks:
|
||||
- protonmail
|
||||
volumes:
|
||||
- protonmail:/root
|
||||
|
||||
backup_protonmail:
|
||||
image: offen/docker-volume-backup:latest
|
||||
restart: always
|
||||
environment:
|
||||
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
|
||||
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-protonmail.tar.gz"
|
||||
BACKUP_LATEST_SYMLINK: protonmail.latest.tar.gz
|
||||
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
|
||||
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
|
||||
volumes:
|
||||
- protonmail:/backup:ro
|
||||
- {{ server.backup.folder }}/protonmail:/archive
|
||||
|
||||
volumes:
|
||||
protonmail:
|
||||
|
||||
networks:
|
||||
protonmail:
|
||||
external: true
|
Loading…
Add table
Add a link
Reference in a new issue