diff --git a/backup_docker_volumes.yml b/backup_docker_volumes.yml index 8ef644e..1298e4e 100644 --- a/backup_docker_volumes.yml +++ b/backup_docker_volumes.yml @@ -1,17 +1,40 @@ --- - name: Backup Docker volumes from remote server hosts: all -# become: yes - tasks: - - name: Ensure local backup directory exists - local_action: file - path=./backups - state=directory - mode=0755 + become: yes + vars: + backup_dir: "./backups" + backup_name: "volumes_{{ ansible_date_time.iso8601_basic_short }}" + archive_path: "/tmp/docker_volumes_backup_{{ ansible_date_time.iso8601_basic_short }}.tar.gz" - - name: Synchronize /var/lib/docker/volumes to local ./backups - synchronize: - src: /var/lib/docker/volumes + + tasks: + - name: Create archive of docker volumes + become: yes + archive: + path: /opt/docker/. + dest: /tmp/{{ backup_name }}.tar.gz + format: gz + + - name: Fetch archive to local machine + become: yes + fetch: + src: /tmp/{{ backup_name }}.tar.gz + dest: ./backups/archive/ + flat: yes + + - name: Clean up archive on remote + become: yes + file: + path: /tmp/{{ backup_name }}.tar.gz + state: absent + + - name: Extract archive locally + become: no + delegate_to: localhost + run_once: true + ansible.builtin.unarchive: + src: ./backups/archive/{{ backup_name }}.tar.gz dest: ./backups/ - mode: pull - delete: no + remote_src: no +# extra_opts: [ "--strip-components=3" ] diff --git a/costil-fast-fix-plz.sh b/costil-fast-fix-plz.sh new file mode 100644 index 0000000..d369136 --- /dev/null +++ b/costil-fast-fix-plz.sh @@ -0,0 +1,5 @@ +1. fix synapse/data/homeserver.yaml -> media_store_path: /data/media_store +2. sudo docker exec -it matrix_synapse /bin/bash +3. chown -R 911:911 /media +4. mv data/media_store/ media/ +5. restore synapse/data/homeserver.yaml -> media_store_path: /media/media_store diff --git a/global/docker-compose.yml b/global/docker-compose.yml index 7930524..e6bd4c9 100644 --- a/global/docker-compose.yml +++ b/global/docker-compose.yml @@ -100,7 +100,7 @@ services: ports: - "51820:51820/udp" volumes: - - wireguard_data:/config + - ./wireguard/config:/config restart: unless-stopped volumes: