From c816f3d55127841e235daa57d321a18765c7a09a Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sat, 11 Nov 2023 14:51:43 +0100 Subject: [PATCH] Intersect apps_backup with apps_include --- roles/apps/defaults/main.yml | 2 +- roles/apps/templates/compose-files/restic.yml.j2 | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/apps/defaults/main.yml b/roles/apps/defaults/main.yml index c4fa704..58f3f1d 100644 --- a/roles/apps/defaults/main.yml +++ b/roles/apps/defaults/main.yml @@ -56,7 +56,7 @@ apps_vars: version: '1.6.0' apps_include: "{{ apps_vars | dict2items | map(attribute='key') | list }}" -apps_backup: "{{ apps_vars | dict2items | selectattr('value.backup', 'true') | map(attribute='key') | list }}" +apps_backup: "{{ apps_vars | dict2items | selectattr('value.backup', 'true') | map(attribute='key') | list | intersect(apps_include) }}" apps_proxied: "{{ apps_vars | dict2items | selectattr('value.domain', 'defined') | map(attribute='key') | list | intersect(apps_include) }}" apps_sender_domains: diff --git a/roles/apps/templates/compose-files/restic.yml.j2 b/roles/apps/templates/compose-files/restic.yml.j2 index 476878f..44c492c 100644 --- a/roles/apps/templates/compose-files/restic.yml.j2 +++ b/roles/apps/templates/compose-files/restic.yml.j2 @@ -31,9 +31,7 @@ services: - "/var/run/docker.sock:/var/run/docker.sock:rw" - "/usr/libexec/docker/cli-plugins/docker-compose:/usr/libexec/docker/cli-plugins/docker-compose:ro" {% for app in apps_backup %} -{% if app in apps_include %} - "{{ apps_data_root }}/{{ app }}/data:/mnt/volumes/{{ app }}:ro" -{% endif %} {% endfor %} prune: