Add role gitea-backup
This commit is contained in:
parent
cf022de69a
commit
efb88c0937
7 changed files with 36 additions and 16 deletions
|
@ -11,14 +11,6 @@ etckeeper:
|
||||||
- run:
|
- run:
|
||||||
- sudo etckeeper commit "First commit"
|
- sudo etckeeper commit "First commit"
|
||||||
|
|
||||||
gitea_backup_rsync:
|
|
||||||
- run:
|
|
||||||
- sudo ln -rsi dotfiles/systemd/gitea_backup_rsync.timer /etc/systemd/system/gitea_backup_rsync.timer
|
|
||||||
- run:
|
|
||||||
- sudo ln -rsi dotfiles/systemd/gitea_backup_rsync.service /etc/systemd/system/gitea_backup_rsync.service
|
|
||||||
- run:
|
|
||||||
- sudo systemctl enable gitea_backup_rsync.timer
|
|
||||||
|
|
||||||
gaming:
|
gaming:
|
||||||
- run:
|
- run:
|
||||||
command: sudo cp /etc/pacman.conf /etc/pacman.conf.backup
|
command: sudo cp /etc/pacman.conf /etc/pacman.conf.backup
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Fetch gitea dumps from Lime2 with rsync
|
|
||||||
Wants=network-online.target
|
|
||||||
After=network-online.target nss-lookup.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=sudo -u flyingscorpio /usr/bin/rsync -zvva --delete tunuifranken.info:/home/git/gitea-dumps /run/media/flyingscorpio/spare/backups/rsync-backups/lime2
|
|
|
@ -29,3 +29,4 @@
|
||||||
- { role: libvirt, tags: libvirt }
|
- { role: libvirt, tags: libvirt }
|
||||||
- { role: mariadb, tags: mariadb }
|
- { role: mariadb, tags: mariadb }
|
||||||
- { role: rsync-backup, tags: rsync-backup }
|
- { role: rsync-backup, tags: rsync-backup }
|
||||||
|
- { role: gitea-backup, tags: gitea-backup }
|
||||||
|
|
|
@ -7,3 +7,5 @@ Persistent=true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
|
||||||
|
# vim: ft=systemd
|
11
roles/gitea-backup/handlers/main.yml
Normal file
11
roles/gitea-backup/handlers/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- name: Run daemon-reload
|
||||||
|
systemd:
|
||||||
|
daemon-reload: true
|
||||||
|
scope: user
|
||||||
|
|
||||||
|
- name: Enable gitea-backup timer
|
||||||
|
systemd:
|
||||||
|
name: gitea-backup.timer
|
||||||
|
enabled: true
|
||||||
|
scope: user
|
14
roles/gitea-backup/tasks/main.yml
Normal file
14
roles/gitea-backup/tasks/main.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
- name: Copy gitea-backup timer
|
||||||
|
copy:
|
||||||
|
src: gitea-backup.timer
|
||||||
|
dest: ~/.config/systemd/user/gitea-backup.timer
|
||||||
|
notify:
|
||||||
|
- Run daemon-reload
|
||||||
|
- Enable gitea-backup timer
|
||||||
|
|
||||||
|
- name: Copy gitea-backup service
|
||||||
|
template:
|
||||||
|
src: gitea-backup.service.j2
|
||||||
|
dest: ~/.config/systemd/user/gitea-backup.service
|
||||||
|
notify: Run daemon-reload
|
8
roles/gitea-backup/templates/gitea-backup.service.j2
Normal file
8
roles/gitea-backup/templates/gitea-backup.service.j2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Fetch gitea dumps from Lime2 with rsync
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target nss-lookup.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/rsync -zvva --delete tunuifranken.info:/home/git/gitea-dumps /run/media/{{ ansible_facts['env']['USER'] }}/spare/backups/rsync-backups/lime2
|
Loading…
Add table
Reference in a new issue