mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Renamed to backup and cleanup roles
This commit is contained in:
3
roles/cleanup-failed-docker-backups/README.md
Normal file
3
roles/cleanup-failed-docker-backups/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Docker Volume Backup Cleanup
|
||||
This script cleans up failed docker backups.
|
||||
It uses https://github.com/kevinveenbirkenbach/cleanup-failed-docker-backups as base.
|
5
roles/cleanup-failed-docker-backups/handlers/main.yml
Normal file
5
roles/cleanup-failed-docker-backups/handlers/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: "reload cleanup-failed-docker-backups.service daemon"
|
||||
systemd:
|
||||
name: cleanup-failed-docker-backups.service
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
3
roles/cleanup-failed-docker-backups/meta/main.yml
Normal file
3
roles/cleanup-failed-docker-backups/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
dependencies:
|
||||
- git
|
||||
- systemd_notifier
|
18
roles/cleanup-failed-docker-backups/tasks/main.yml
Normal file
18
roles/cleanup-failed-docker-backups/tasks/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- name: pull cleanup-failed-docker-backups.git
|
||||
git:
|
||||
repo: "https://github.com/kevinveenbirkenbach/cleanup-failed-docker-backups.git"
|
||||
dest: "{{docker_volume_backup_cleanup_folder}}"
|
||||
update: yes
|
||||
register: git_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Warn if repo is not reachable
|
||||
debug:
|
||||
msg: "Warning: Repository is not reachable."
|
||||
when: git_result.failed
|
||||
|
||||
- name: configure cleanup-failed-docker-backups.service
|
||||
template:
|
||||
src: cleanup-failed-docker-backups.service.j2
|
||||
dest: /etc/systemd/system/cleanup-failed-docker-backups.service
|
||||
notify: reload cleanup-failed-docker-backups.service daemon
|
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Cleans up failed docker volume backups
|
||||
OnFailure=systemd-notifier@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c '/usr/bin/yes | /usr/bin/bash {{docker_volume_backup_cleanup_folder}}cleanup.sh {{docker_volume_backup_cleanup_machine_id}} {{docker_volume_backup_cleanup_trigger_directory}}'
|
1
roles/cleanup-failed-docker-backups/vars/main.yml
Normal file
1
roles/cleanup-failed-docker-backups/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
docker_volume_backup_cleanup_folder: "{{path_administrator_scripts}}cleanup-failed-docker-backups/"
|
Reference in New Issue
Block a user