Extend odroid playbook to find old backups of remote servers.
This commit is contained in:
@@ -209,7 +209,7 @@
|
|||||||
register: backup_server_dirs
|
register: backup_server_dirs
|
||||||
loop: "{{ servers }}"
|
loop: "{{ servers }}"
|
||||||
|
|
||||||
- name: Find old daily backups
|
- name: Find servers old daily backups
|
||||||
find:
|
find:
|
||||||
path: "{{ item.path }}/daily"
|
path: "{{ item.path }}/daily"
|
||||||
file_type: file
|
file_type: file
|
||||||
@@ -222,9 +222,10 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.path }}"
|
label: "{{ item.path }}"
|
||||||
|
|
||||||
- name: Check old backup file variable
|
- name: Delete servers old daily backups
|
||||||
debug:
|
file:
|
||||||
var: item.path
|
path: "{{ item.path }}"
|
||||||
|
state: absent
|
||||||
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.path }}"
|
label: "{{ item.path }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user