From 0d73ab364b3d0d9bcf0015f2043573e879c936c1 Mon Sep 17 00:00:00 2001 From: chsteinle Date: Tue, 21 Dec 2021 08:17:57 +0100 Subject: [PATCH] Extend odroid playbook to find old backups of remote servers. --- odroid.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/odroid.yaml b/odroid.yaml index 563d4d2..ca61300 100644 --- a/odroid.yaml +++ b/odroid.yaml @@ -209,7 +209,7 @@ register: backup_server_dirs loop: "{{ servers }}" - - name: Find old daily backups + - name: Find servers old daily backups find: path: "{{ item.path }}/daily" file_type: file @@ -222,9 +222,10 @@ loop_control: label: "{{ item.path }}" - - name: Check old backup file variable - debug: - var: item.path + - name: Delete servers old daily backups + file: + path: "{{ item.path }}" + state: absent with_items: "{{ backup_files.results | map(attribute='files') | list }}" loop_control: label: "{{ item.path }}"