Compare commits
1 Commits
cedc23fca3
...
305a7a7f67
Author | SHA1 | Date | |
---|---|---|---|
305a7a7f67 |
@ -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
|
- name: Get stats of docker-compose.yaml
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /opt/gitea/docker-compose.yaml
|
path: /opt/gitea/docker-compose.yaml
|
||||||
@ -18,11 +25,11 @@
|
|||||||
when: docker_compose_stat.stat.exists is defined and docker_compose_stat.stat.exists
|
when: docker_compose_stat.stat.exists is defined and docker_compose_stat.stat.exists
|
||||||
|
|
||||||
- name: Backup Gitea Directory
|
- name: Backup Gitea Directory
|
||||||
community.general.archive:
|
ansible.posix.synchronize:
|
||||||
path: /opt/gitea/
|
src: /opt/gitea/
|
||||||
dest: "/var/backups/gitea-{{ gitea.hostname }}.{{ gitea.domain }}@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}.gz"
|
dest: "/var/backups/gitea.backup@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}"
|
||||||
format: gz
|
recursive: true
|
||||||
force_archive: true
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
listen:
|
listen:
|
||||||
- Backup Gitea
|
- Backup Gitea
|
||||||
register: backup
|
register: backup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user