From d3628d90b9029285f4e165efec9ac770199b95af Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 2 Jan 2024 08:28:00 +0100 Subject: [PATCH] Implemented cleaning up of all backups --- .../cleanup-failed-docker-backups.service.j2 | 2 +- roles/user-administrator/tasks/main.yml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/roles/cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 b/roles/cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 index 335fc471..e047cf65 100644 --- a/roles/cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 +++ b/roles/cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 @@ -5,4 +5,4 @@ OnFailure=systemd-notifier@%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 "{{sytem_maintenance_lock_timeoutbackup_services}}"' -ExecStart=/bin/sh -c '/usr/bin/yes | /usr/bin/bash {{backup_docker_to_local_cleanup_folder}}cleanup.sh {{backup_docker_to_local_cleanup_machine_id}} {{backup_docker_to_local_cleanup_trigger_directory}}' \ No newline at end of file +ExecStart=/bin/sh -c '/usr/bin/yes | /usr/bin/bash {{backup_docker_to_local_cleanup_folder}}cleanup-all.sh {{backup_docker_to_local_cleanup_trigger_directory}}' \ No newline at end of file diff --git a/roles/user-administrator/tasks/main.yml b/roles/user-administrator/tasks/main.yml index de55b794..e9c1c0da 100644 --- a/roles/user-administrator/tasks/main.yml +++ b/roles/user-administrator/tasks/main.yml @@ -8,7 +8,16 @@ ssh_key_type: rsa ssh_key_bits: 8192 when: run_once_user_administrator is not defined - + +- name: "set correct rights for {{path_administrator_home}}" + file: + path: "{{path_administrator_home}}" + state: directory + owner: administrator + group: administrator + mode: 0700 + when: run_once_user_administrator is not defined + - name: "create {{path_administrator_scripts}}" file: path: "{{path_administrator_home}}scripts"