2023-02-02 05:30:14 +00:00
|
|
|
---
|
2023-02-03 21:40:59 +00:00
|
|
|
# based on advice from https://docs.gitea.io/en-us/backup-and-restore/
|
|
|
|
|
2023-02-02 05:30:14 +00:00
|
|
|
- name: Stop Gitea
|
|
|
|
systemd:
|
|
|
|
name: gitea
|
|
|
|
enabled: yes
|
|
|
|
state: stopped
|
2023-02-03 21:40:59 +00:00
|
|
|
tags: backup
|
|
|
|
|
|
|
|
- name: Make Temp dir
|
|
|
|
file:
|
|
|
|
path: /etc/gitea/temp
|
|
|
|
state: directory
|
|
|
|
owner: gitea
|
|
|
|
tags: backup
|
2023-02-02 05:30:14 +00:00
|
|
|
|
|
|
|
- name: Dump Gitea
|
|
|
|
shell:
|
2024-04-09 21:32:01 +00:00
|
|
|
cmd: gitea dump -c /etc/gitea/gitea.ini --work-path=/etc/gitea --file=gitea-dump.zip --tempdir=/etc/gitea/temp
|
2023-02-02 05:30:14 +00:00
|
|
|
chdir: /etc/gitea
|
|
|
|
become: true
|
|
|
|
become_method: su
|
|
|
|
become_user: gitea
|
2023-02-03 21:40:59 +00:00
|
|
|
tags: backup
|
|
|
|
|
|
|
|
- name: Fetch backup
|
|
|
|
fetch:
|
|
|
|
src: /etc/gitea/gitea-dump.zip
|
|
|
|
dest: "{{ giteaBackup }}"
|
|
|
|
flat: true
|
|
|
|
tags: backup
|
|
|
|
|
|
|
|
- name: Remove remote dump
|
|
|
|
file:
|
|
|
|
path: "{{ giteaBackup }}"
|
|
|
|
state: absent
|
|
|
|
tags: backup
|
|
|
|
|
|
|
|
- name: Remove Temp
|
|
|
|
file:
|
|
|
|
path: /etc/gitea/temp
|
|
|
|
state: absent
|
|
|
|
tags: backup
|
2023-02-02 05:30:14 +00:00
|
|
|
|
|
|
|
- name: Start Gitea
|
|
|
|
systemd:
|
|
|
|
name: gitea
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
2023-02-03 21:40:59 +00:00
|
|
|
tags: backup
|