mirror of
https://github.com/CPunch/openpunk-ansible.git
synced 2024-11-21 15:00:05 +00:00
gitea: can now backup the database remotely
This commit is contained in:
parent
bf198f9d63
commit
feaea47028
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
hosts
|
hosts
|
||||||
|
backups
|
@ -1,3 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
domain: openpunk.com
|
||||||
contact_email: openpunk@proton.me
|
contact_email: openpunk@proton.me
|
||||||
onionDomain: http://opnpnk6eutjiqy4ndpyvwxd5pncj2g2cmz6fkocr5uh3omnn4utvspad.onion
|
onionDomain: http://opnpnk6eutjiqy4ndpyvwxd5pncj2g2cmz6fkocr5uh3omnn4utvspad.onion
|
@ -18,10 +18,6 @@
|
|||||||
- zsh # :D
|
- zsh # :D
|
||||||
- python3-certbot-nginx
|
- python3-certbot-nginx
|
||||||
|
|
||||||
- name: Grab package facts
|
|
||||||
package_facts:
|
|
||||||
manager: auto
|
|
||||||
|
|
||||||
- name: Setup zsh
|
- name: Setup zsh
|
||||||
user:
|
user:
|
||||||
name: "{{ ansible_user }}"
|
name: "{{ ansible_user }}"
|
||||||
|
25
roles/gitea/tasks/backup.yml
Normal file
25
roles/gitea/tasks/backup.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- name: Stop Gitea
|
||||||
|
systemd:
|
||||||
|
name: gitea
|
||||||
|
enabled: yes
|
||||||
|
state: stopped
|
||||||
|
|
||||||
|
- name: Dump Gitea
|
||||||
|
shell:
|
||||||
|
cmd: gitea dump -c /etc/gitea/app.ini --work-path=/etc/gitea --file=gitea-dump.zip
|
||||||
|
chdir: /etc/gitea
|
||||||
|
become: true
|
||||||
|
become_method: su
|
||||||
|
become_user: gitea
|
||||||
|
|
||||||
|
- name: Start Gitea
|
||||||
|
systemd:
|
||||||
|
name: gitea
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: Fetch backup
|
||||||
|
fetch:
|
||||||
|
src: /etc/gitea/gitea-dump.zip
|
||||||
|
dest: backups
|
@ -4,6 +4,10 @@
|
|||||||
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||||
register: gitea_key
|
register: gitea_key
|
||||||
|
|
||||||
|
- name: Grab package facts
|
||||||
|
package_facts:
|
||||||
|
manager: auto
|
||||||
|
|
||||||
- name: Install Gitea
|
- name: Install Gitea
|
||||||
block:
|
block:
|
||||||
- name: Add Gitea key, repository && install
|
- name: Add Gitea key, repository && install
|
||||||
@ -34,6 +38,10 @@
|
|||||||
name: gitea
|
name: gitea
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
|
- name: Backup db
|
||||||
|
include_tasks: backup.yml
|
||||||
|
tags: ['never', 'backup']
|
||||||
when: giteaUninstall == false
|
when: giteaUninstall == false
|
||||||
|
|
||||||
- name: Uninstall Gitea
|
- name: Uninstall Gitea
|
||||||
|
6
run.yml
6
run.yml
@ -8,11 +8,6 @@
|
|||||||
vars_files:
|
vars_files:
|
||||||
- group_vars/all.yml
|
- group_vars/all.yml
|
||||||
|
|
||||||
vars_prompt:
|
|
||||||
- name: domain
|
|
||||||
prompt: domain pointing to the vps
|
|
||||||
private: no
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: essential
|
- role: essential
|
||||||
- role: firewall
|
- role: firewall
|
||||||
@ -20,6 +15,7 @@
|
|||||||
- role: deadswitch
|
- role: deadswitch
|
||||||
- role: blog
|
- role: blog
|
||||||
- role: gitea
|
- role: gitea
|
||||||
|
tags: [backup]
|
||||||
- role: nginx
|
- role: nginx
|
||||||
- role: goaccess
|
- role: goaccess
|
||||||
- role: tor
|
- role: tor
|
Loading…
Reference in New Issue
Block a user