From 7004174da70ef1f9b0180e8299e8aff9aad60030 Mon Sep 17 00:00:00 2001 From: Wilfried BARADAT Date: Thu, 29 Feb 2024 18:26:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(apps)=20skip=20app=20filtering=20w?= =?UTF-8?q?hen=20`apps=5Ffilter`=20is=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `set_vars` playbook attempted to filter apps even when no specific apps were provided for filtering (e.g. with an empty `apps_filter`). Thus, we now require the `apps_filter` extra var to be defined and not empty. --- CHANGELOG.md | 4 ++++ tasks/set_vars.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d666cae..b4e783cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +### Fixed + +- App filtering when `apps_filter` variable is set but empty + ## [6.19.1] - 2023-09-15 ### Fixed diff --git a/tasks/set_vars.yml b/tasks/set_vars.yml index bc6736d6..196ed647 100644 --- a/tasks/set_vars.yml +++ b/tasks/set_vars.yml @@ -118,7 +118,7 @@ # We use escaped double quotes in the first regex_replace filter to be able # to add single quotes around app name in the query apps_filter_query: "[?{{ apps_filter.split(',') | map('regex_replace', '([\\w-]+)', \"name=='\\1'\") | join(' || ') }}]" # noqa jinja[spacing] - when: apps_filter is defined + when: apps_filter is defined and apps_filter | length > 1 - name: Filter apps ansible.builtin.set_fact: