mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-14 00:41:06 +01:00
34 lines
1.4 KiB
YAML
34 lines
1.4 KiB
YAML
- name: pull cleanup-failed-docker-backups.git
|
|
git:
|
|
repo: "https://github.com/kevinveenbirkenbach/cleanup-failed-docker-backups.git"
|
|
dest: "{{backup_docker_to_local_cleanup_folder}}"
|
|
update: yes
|
|
register: git_result
|
|
ignore_errors: true
|
|
when: run_once_cleanup_failed_docker_backups is not defined
|
|
|
|
- name: Warn if repo is not reachable
|
|
debug:
|
|
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 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
|
|
when: run_once_cleanup_failed_docker_backups is not defined
|
|
|
|
- name: create cleanup-failed-docker-backups.timer
|
|
template:
|
|
src: cleanup-failed-docker-backups.timer.j2
|
|
dest: /etc/systemd/system/cleanup-failed-docker-backups.timer
|
|
register: cleanup_failed_docker_backups_timer
|
|
changed_when: cleanup_failed_docker_backups_timer.changed or activate_all_timers | bool
|
|
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 |