2023-11-16 17:07:28 +01:00
|
|
|
- name: pull cleanup-failed-docker-backups.git
|
|
|
|
git:
|
|
|
|
repo: "https://github.com/kevinveenbirkenbach/cleanup-failed-docker-backups.git"
|
2023-11-17 12:35:39 +01:00
|
|
|
dest: "{{backup_docker_to_local_cleanup_folder}}"
|
2023-11-16 17:07:28 +01:00
|
|
|
update: yes
|
|
|
|
register: git_result
|
|
|
|
ignore_errors: true
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_cleanup_failed_docker_backups is not defined
|
2023-11-16 17:07:28 +01:00
|
|
|
|
|
|
|
- name: Warn if repo is not reachable
|
|
|
|
debug:
|
|
|
|
msg: "Warning: Repository is not reachable."
|
2023-12-12 15:10:11 +01:00
|
|
|
when: git_result is defined and git_result.failed is defined and run_once_cleanup_failed_docker_backups is not defined
|
2023-11-16 17:07:28 +01:00
|
|
|
|
|
|
|
- name: configure cleanup-failed-docker-backups.service
|
|
|
|
template:
|
|
|
|
src: cleanup-failed-docker-backups.service.j2
|
|
|
|
dest: /etc/systemd/system/cleanup-failed-docker-backups.service
|
2023-12-12 15:10:11 +01:00
|
|
|
notify: reload cleanup-failed-docker-backups.service daemon
|
|
|
|
when: run_once_cleanup_failed_docker_backups is not defined
|
|
|
|
|
2023-12-18 12:20:05 +01:00
|
|
|
- name: create cleanup-failed-docker-backups.timer
|
|
|
|
template:
|
|
|
|
src: cleanup-failed-docker-backups.timer.j2
|
|
|
|
dest: /etc/systemd/system/cleanup-failed-docker-backups.timer
|
2023-12-18 17:38:08 +01:00
|
|
|
register: cleanup_failed_docker_backups_timer
|
2024-01-02 12:23:25 +01:00
|
|
|
changed_when: cleanup_failed_docker_backups_timer.changed or activate_all_timers
|
2023-12-26 03:31:30 +01:00
|
|
|
notify: restart cleanup-failed-docker-backups.timer
|
|
|
|
when: run_once_cleanup_failed_docker_backups is not defined
|
|
|
|
|
|
|
|
- name: run the cleanup_failed_docker_backups tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_cleanup_failed_docker_backups: true
|
|
|
|
when: run_once_cleanup_failed_docker_backups is not defined
|