Implemented server tact

This commit is contained in:
Kevin Veen-Birkenbach 2023-04-15 17:06:10 +02:00
parent 0f7a2fcb9e
commit 9f0df846df
24 changed files with 60 additions and 44 deletions

10
group_vars/all Normal file
View File

@ -0,0 +1,10 @@
# Server Tact Variables
# @see https://man.archlinux.org/man/systemd.time.7
on_calendar_btrfs_health_check: "*-*-* 00:00:00"
on_calendar_journalctl_health_check: "*-*-* 00:00:00"
on_calendar_docker_health_check: "*-*-* 09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,00,01,02:00:00"
on_calendar_backups_cleanup: "*-*-* 06,12,18,00:30:00"
on_calendar_docker_volume_backup: "*-*-* 03:30:00"
on_calendar_docker_compose_restart_unhealthy: "*-*-* 09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,00,01:30:00"
on_calendar_pull_primary_backups: "*-*-* 21:30:00"

View File

@ -60,7 +60,7 @@ How to manage users is described here: https://mailu.io/master/cli.html
### database access
To access the database execute
```bash
docker exec -it nextcloud_database_1 mysql -u nextcloud -D nextcloud -p
docker exec -it mailu-database-1 mysql -u root -D mailu -p
```
### mailu_front_1

View File

@ -1,2 +1 @@
mailu_front_container_name: "mailu-front-1"
mailu_version: "1.9"

View File

@ -1,7 +1,7 @@
- name: "restart backups-cleanup.service"
- name: "reload backups-cleanup.service"
systemd:
name: backups-cleanup.service
state: restarted
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart backups-cleanup.timer"

View File

@ -13,10 +13,10 @@
- name: create backups-cleanup.service
template: src=backups-cleanup.service.j2 dest=/etc/systemd/system/backups-cleanup.service
notify: restart backups-cleanup.service
notify: reload backups-cleanup.service
- name: create backups-cleanup.timer
copy:
src: backups-cleanup.timer
template:
src: backups-cleanup.timer.j2
dest: "/etc/systemd/system/backups-cleanup.timer"
notify: restart backups-cleanup.timer

View File

@ -3,8 +3,7 @@ Description=starts backups-cleanup.service
[Timer]
OnBootSec=1min
OnUnitActiveSec=3h
RandomizedDelaySec=1h
OnCalendar={{on_calendar_backups_cleanup}}
[Install]
WantedBy=timers.target

View File

@ -1,7 +1,7 @@
- name: "restart btrfs-health-check.service"
- name: "reload btrfs-health-check.service"
systemd:
name: btrfs-health-check.service
state: restarted
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart btrfs-health-check.timer"

View File

@ -13,10 +13,10 @@
template:
src: btrfs-health-check.service.j2
dest: /etc/systemd/system/btrfs-health-check.service
notify: restart btrfs-health-check.service
notify: reload btrfs-health-check.service
- name: create btrfs-health-check.timer
copy:
src: btrfs-health-check.timer
template:
src: btrfs-health-check.timer.j2
dest: "/etc/systemd/system/btrfs-health-check.timer"
notify: restart btrfs-health-check.timer

View File

@ -2,7 +2,7 @@
Description=starts btrfs-health-check.service
[Timer]
OnCalendar=12:00
OnCalendar={{on_calendar_btrfs_health_check}}
[Install]
WantedBy=timers.target

View File

@ -1,4 +1,4 @@
- name: "reloaded docker-compose-restart-unhealthy.service"
- name: "reload docker-compose-restart-unhealthy.service"
systemd:
name: docker-compose-restart-unhealthy.service
state: reloaded

View File

@ -13,10 +13,10 @@
template:
src: docker-compose-restart-unhealthy.service.j2
dest: /etc/systemd/system/docker-compose-restart-unhealthy.service
notify: reloaded docker-compose-restart-unhealthy.service
notify: reload docker-compose-restart-unhealthy.service
- name: create docker-compose-restart-unhealthy.timer
copy:
src: docker-compose-restart-unhealthy.timer
template:
src: docker-compose-restart-unhealthy.timer.j2
dest: "/etc/systemd/system/docker-compose-restart-unhealthy.timer"
notify: restart docker-compose-restart-unhealthy.timer

View File

@ -2,8 +2,7 @@
Description=starts docker-compose-restart-unhealthy.service
[Timer]
OnBootSec=1min
OnUnitActiveSec=1h
OnCalendar={{on_calendar_docker_compose_restart_unhealthy}}
[Install]
WantedBy=timers.target

View File

@ -1,7 +1,7 @@
- name: "restart docker-health-check.service"
- name: "reload docker-health-check.service"
systemd:
name: docker-health-check.service
state: restarted
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart docker-health-check.timer"

View File

@ -11,10 +11,10 @@
- name: create docker-health-check.service
template: src=docker-health-check.service.j2 dest=/etc/systemd/system/docker-health-check.service
notify: restart docker-health-check.service
notify: reload docker-health-check.service
- name: create docker-health-check.timer
copy:
src: docker-health-check.timer
template:
src: docker-health-check.timer.j2
dest: "/etc/systemd/system/docker-health-check.timer"
notify: restart docker-health-check.timer

View File

@ -2,7 +2,7 @@
Description=starts docker-health-check.service
[Timer]
OnCalendar=10:00
OnCalendar={{on_calendar_docker_health_check}}
[Install]
WantedBy=timers.target

View File

@ -1,7 +1,7 @@
- name: "restart docker-volume-backup service"
- name: "reload docker-volume-backup service"
systemd:
name: docker-volume-backup.service
state: restarted
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart docker-volume-backup timer"

View File

@ -8,9 +8,11 @@
dest: "{{docker_volume_backup_folder}}"
update: yes
- name: configure docker-volume-backup.service.tpl
template: src=docker-volume-backup.service.j2 dest=/etc/systemd/system/docker-volume-backup.service
notify: restart docker-volume-backup service
- name: configure docker-volume-backup.service
template:
src: docker-volume-backup.service.j2
dest: /etc/systemd/system/docker-volume-backup.service
notify: reload docker-volume-backup service
- name: configure docker-volume-backup.timer.tpl
template: src=docker-volume-backup.timer.j2 dest=/etc/systemd/system/docker-volume-backup.timer

View File

@ -2,8 +2,7 @@
Description=backups the docker volumes
[Timer]
OnCalendar=3:00
RandomizedDelaySec=1h
OnCalendar={{on_calendar_docker_volume_backup}}
[Install]
WantedBy=timers.target

View File

@ -1,3 +1,9 @@
- name: "reload journalctl-health-check.service"
systemd:
name: journalctl-health-check.service
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart journalctl-health-check.timer"
systemd:
name: journalctl-health-check.timer

View File

@ -10,10 +10,13 @@
dest: "{{journalctl_health_check_folder}}journalctl-health-check.sh"
- name: create journalctl-health-check.service
template: src=journalctl-health-check.service.j2 dest=/etc/systemd/system/journalctl-health-check.service
template:
src: journalctl-health-check.service.j2
dest: /etc/systemd/system/journalctl-health-check.service
notify: reload journalctl-health-check.service
- name: create journalctl-health-check.timer
copy:
src: journalctl-health-check.timer
dest: "/etc/systemd/system/journalctl-health-check.timer"
template:
src: journalctl-health-check.timer.j2
dest: /etc/systemd/system/journalctl-health-check.timer
notify: restart journalctl-health-check.timer

View File

@ -2,7 +2,7 @@
Description=starts journalctl-health-check.service
[Timer]
OnCalendar=00:00
OnCalendar={{on_calendar_journalctl_health_check}}
[Install]
WantedBy=timers.target

View File

@ -1,7 +1,7 @@
- name: "restart pull-remote-backups service"
- name: "reload pull-remote-backups service"
systemd:
name: pull-remote-backups.service
state: restarted
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart pull-remote-backups timer"

View File

@ -12,7 +12,7 @@
- name: create pull-remote-backups.service
template: src=pull-remote-backups.service.j2 dest=/etc/systemd/system/pull-remote-backups.service
notify: restart pull-remote-backups service
notify: reload pull-remote-backups service
- name: create pull-remote-backups.timer
template: src=pull-remote-backups.timer.j2 dest=/etc/systemd/system/pull-remote-backups.timer

View File

@ -2,8 +2,7 @@
Description=starts pull remote backup timer
[Timer]
OnCalendar=22:00
RandomizedDelaySec=1h
OnCalendar={{on_calendar_pull_primary_backups}}
[Install]
WantedBy=timers.target