38 lines
1.5 KiB
YAML

- name: install cleanup-failed-docker-backups
command:
cmd: "pkgmgr install cleanup-failed-docker-backups --clone-mode https"
when: run_once_cleanup_failed_docker_backups is not defined
- name: Retrieve backup-docker-to-local path from pkgmgr
command: pkgmgr path cleanup-failed-docker-backups
register: pkgmgr_output
when: run_once_cleanup_failed_docker_backups is not defined
- name: Set fact for backup_docker_to_local_cleanup_folder
set_fact:
backup_docker_to_local_cleanup_folder: "{{ pkgmgr_output.stdout }}"
when: run_once_cleanup_failed_docker_backups is not defined
- name: configure cleanup-failed-docker-backups.cymais.service
template:
src: cleanup-failed-docker-backups.service.j2
dest: /etc/systemd/system/cleanup-failed-docker-backups.cymais.service
notify: reload cleanup-failed-docker-backups.cymais.service daemon
when: run_once_cleanup_failed_docker_backups is not defined
- name: set service_name to the name of the current role
set_fact:
service_name: "{{ role_name }}"
when: run_once_cleanup_failed_docker_backups is not defined
- name: "include role for systemd-timer for {{service_name}}"
include_role:
name: systemd-timer
vars:
on_calendar: "{{on_calendar_cleanup_failed_docker}}"
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