mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-21 20:31:02 +01:00
implemented backup of everything before docker update
This commit is contained in:
parent
42092855c7
commit
f58a36ea34
@ -70,6 +70,7 @@ system_maintenance_backup_services:
|
||||
- "backup-docker-to-local"
|
||||
- "backup-remote-to-local"
|
||||
- "backup-data-to-usb"
|
||||
- "backup-docker-to-local-everything"
|
||||
|
||||
### Defined Services for System Cleanup
|
||||
system_maintenance_cleanup_services:
|
||||
|
@ -3,6 +3,11 @@
|
||||
name: backup-docker-to-local.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "reload backup-docker-to-local-everything.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local-everything.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart backup-docker-to-local.timer"
|
||||
systemd:
|
||||
name: backup-docker-to-local.timer
|
||||
|
@ -20,6 +20,13 @@
|
||||
msg: "Warning: Repository is not reachable."
|
||||
when: git_result is defined and git_result.failed is defined and run_once_cleanup_failed_docker_backups is not defined
|
||||
|
||||
- name: configure backup-docker-to-local-everything.service
|
||||
template:
|
||||
src: backup-docker-to-local-everything.service.j2
|
||||
dest: /etc/systemd/system/backup-docker-to-local-everything.service
|
||||
notify: reload backup-docker-to-local-everything.service
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: configure backup-docker-to-local.service
|
||||
template:
|
||||
src: backup-docker-to-local.service.j2
|
||||
|
@ -4,5 +4,5 @@ OnFailure=systemd-notifier@%n.service cleanup-failed-docker-backups.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_backup_services| join(' ') }} --timeout "{{sytem_maintenance_lock_timeoutbackup_services}}"'
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'backup-docker-to-local-everything') | join(' ') }} --timeout "{{sytem_maintenance_lock_timeoutbackup_services}}"'
|
||||
ExecStart=/bin/sh -c '/usr/bin/python {{backup_docker_to_local_folder}}backup-docker-to-local.py'
|
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=backup docker volumes to local folder
|
||||
OnFailure=systemd-notifier@%n.service cleanup-failed-docker-backups.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'backup-docker-to-local') | join(' ') }} --timeout "{{sytem_maintenance_lock_timeoutbackup_services}}"'
|
||||
ExecStart=/bin/sh -c '/usr/bin/python {{backup_docker_to_local_folder}}backup-docker-to-local.py --everything'
|
@ -1,6 +1,6 @@
|
||||
- name: "start backup-docker-to-local.service"
|
||||
- name: "start backup-docker-to-local-everything.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local.service
|
||||
name: backup-docker-to-local-everything.service
|
||||
state: started
|
||||
when: force_backup_before_update | bool
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user