From 1622fae1a0bfcddb0be7ac4ce1dda998fe24e1a0 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Fri, 12 Sep 2025 23:56:23 +0200 Subject: [PATCH] Set backup paths automatically only if not already set --- tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/main.yml b/tasks/main.yml index d9ad759..ce7024c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,7 @@ - set_fact: all_backup_paths: "{{ all_backup_paths | default([]) + (lookup('file', 'inventory/group_vars/' + item + '.yml') | from_yaml | dict2items | selectattr('key', 'equalto', 'backup_paths') | map(attribute='value') | list | first | default([])) }}" loop: "{{ group_names }}" + when: all_backup_paths is not defined - debug: var: all_backup_paths