Solved cleanup-failed-docker-backups path bug

This commit is contained in:
Kevin Veen-Birkenbach 2025-04-16 10:18:18 +02:00
parent 9c680a26f7
commit de94fe4ae3
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
3 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,6 @@
- name: "reload cleanup-failed-docker-backups.cymais.service daemon"
- name: "Reload and restart cleanup-failed-docker-backups.cymais.service"
systemd:
name: cleanup-failed-docker-backups.cymais.service
enabled: yes
daemon_reload: yes
state: restarted

View File

@ -10,16 +10,16 @@
register: pkgmgr_output
when: run_once_cleanup_failed_docker_backups is not defined
- name: Set fact for backup_docker_to_local_cleanup_folder
- name: Set fact for backup_docker_to_local_cleanup_script
set_fact:
backup_docker_to_local_cleanup_folder: "{{ pkgmgr_output.stdout }}"
backup_docker_to_local_cleanup_script: "{{ pkgmgr_output.stdout.rstrip('/') ~ '/cleanup-all.sh' }}"
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
notify: Reload and restart cleanup-failed-docker-backups.cymais.service
when: run_once_cleanup_failed_docker_backups is not defined
- name: set service_name to the name of the current role

View File

@ -5,4 +5,4 @@ OnFailure=systemd-notifier.cymais@%n.service
[Service]
Type=oneshot
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_cleanup_services| join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
ExecStart=/bin/sh -c '/usr/bin/yes | /usr/bin/bash {{backup_docker_to_local_cleanup_folder}}cleanup-all.sh'
ExecStart=/bin/sh -c '/usr/bin/yes | /usr/bin/bash {{backup_docker_to_local_cleanup_script}}'