diff --git a/handlers/backup.yaml b/handlers/backup.yaml index fc68ccf..fd17328 100644 --- a/handlers/backup.yaml +++ b/handlers/backup.yaml @@ -1,3 +1,10 @@ +- name: Ensure backup directory exists + ansible.builtin.file: + path: "/var/backups" + state: directory + owner: root + mode: "755" + - name: Get stats of docker-compose.yaml ansible.builtin.stat: path: /opt/gitea/docker-compose.yaml @@ -20,7 +27,7 @@ - name: Backup Gitea Directory ansible.posix.synchronize: src: /opt/gitea/ - dest: "/opt/gitea.backup@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}" + dest: "/var/backups/gitea.backup@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}" recursive: true delegate_to: "{{ inventory_hostname }}" listen: