Add Template to deploy forgejo.
This template allows deploying a forgejo en either Scaleway or Hetzner (untested) without much knowledge about them. It DOES require knowledge about Terragrunt and ansible. A wizard of sorts is provided but it will not guarantee success without some knowledge about the underlying technology.
This commit is contained in:
parent
a9f546f92a
commit
822e42dbb8
48 changed files with 6846 additions and 2 deletions
32
ansible/roles/forgejo/tasks/backup.yml
Normal file
32
ansible/roles/forgejo/tasks/backup.yml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
# Backup configuration tasks
|
||||
|
||||
- name: Create backup script
|
||||
ansible.builtin.template:
|
||||
src: forgejo_backup.sh.j2
|
||||
dest: /usr/local/bin/forgejo_backup.sh
|
||||
mode: '0755'
|
||||
become: yes
|
||||
|
||||
- name: Set up backup cron job
|
||||
ansible.builtin.cron:
|
||||
name: "Forgejo daily backup"
|
||||
minute: "{{ forgejo_backup_schedule.split()[0] }}"
|
||||
hour: "{{ forgejo_backup_schedule.split()[1] }}"
|
||||
job: "/usr/local/bin/forgejo_backup.sh >> /var/log/forgejo-backup.log 2>&1"
|
||||
become: yes
|
||||
|
||||
- name: Create log rotation for backup logs
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/logrotate.d/forgejo-backup
|
||||
content: |
|
||||
/var/log/forgejo-backup.log {
|
||||
daily
|
||||
rotate 7
|
||||
compress
|
||||
delaycompress
|
||||
missingok
|
||||
notifempty
|
||||
}
|
||||
mode: '0644'
|
||||
become: yes
|
||||
Loading…
Add table
Add a link
Reference in a new issue