ansible-role-gitea/handlers/backup.yaml

21 lines
499 B
YAML
Raw Normal View History

2023-05-01 01:48:07 +02:00
- name: Stop Gitea for Backup
community.docker.docker_compose:
project_src: /opt/gitea
state: present
stopped: true
ignore_errors: true
listen:
- Backup Gitea
notify:
- Ensure Gitea is running
- name: Backup Gitea Directory
2023-05-01 01:56:59 +02:00
ansible.builtin.synchronize:
2023-05-01 01:48:07 +02:00
src: /opt/gitea/
dest: "/opt/gitea.backup@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}"
2023-05-01 01:56:59 +02:00
recursive: true
delegate_to: "{{ inventory_hostname }}"
2023-05-01 01:48:07 +02:00
listen:
- Backup Gitea
register: backup