mirror of
https://github.com/CPunch/openpunk-ansible.git
synced 2024-10-09 03:52:49 +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
|
||||
onionDomain: http://opnpnk6eutjiqy4ndpyvwxd5pncj2g2cmz6fkocr5uh3omnn4utvspad.onion
|
@ -18,10 +18,6 @@
|
||||
- zsh # :D
|
||||
- python3-certbot-nginx
|
||||
|
||||
- name: Grab package facts
|
||||
package_facts:
|
||||
manager: auto
|
||||
|
||||
- name: Setup zsh
|
||||
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
|
||||
register: gitea_key
|
||||
|
||||
- name: Grab package facts
|
||||
package_facts:
|
||||
manager: auto
|
||||
|
||||
- name: Install Gitea
|
||||
block:
|
||||
- name: Add Gitea key, repository && install
|
||||
@ -34,6 +38,10 @@
|
||||
name: gitea
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Backup db
|
||||
include_tasks: backup.yml
|
||||
tags: ['never', 'backup']
|
||||
when: giteaUninstall == false
|
||||
|
||||
- name: Uninstall Gitea
|
||||
|
6
run.yml
6
run.yml
@ -8,11 +8,6 @@
|
||||
vars_files:
|
||||
- group_vars/all.yml
|
||||
|
||||
vars_prompt:
|
||||
- name: domain
|
||||
prompt: domain pointing to the vps
|
||||
private: no
|
||||
|
||||
roles:
|
||||
- role: essential
|
||||
- role: firewall
|
||||
@ -20,6 +15,7 @@
|
||||
- role: deadswitch
|
||||
- role: blog
|
||||
- role: gitea
|
||||
tags: [backup]
|
||||
- role: nginx
|
||||
- role: goaccess
|
||||
- role: tor
|
Loading…
Reference in New Issue
Block a user