From 80a9e8c1563fb2b79320ac07154c1577e156cb29 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Wed, 27 Mar 2024 14:31:53 -0400 Subject: [PATCH] postgresql: Cast sorted_old_postgres_pods as list (#1791) With ansible 2.9.27 (operator-sdk v1.27.0) then the reverse filter returns an iterator so we need to cast it to list. The behavior doesn't exist when using a more recent operator-sdk version like v1.34.0 (ansible-core 2.15.8) but using the list filter on that version works too (even if not needed) "sorted_old_postgres_pods": "" Signed-off-by: Dimitri Savineau --- roles/installer/tasks/database_configuration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/installer/tasks/database_configuration.yml b/roles/installer/tasks/database_configuration.yml index 8165a1fb8..424580688 100644 --- a/roles/installer/tasks/database_configuration.yml +++ b/roles/installer/tasks/database_configuration.yml @@ -129,7 +129,7 @@ set_fact: sorted_old_postgres_pods: "{{ filtered_old_postgres_pods | sort(attribute='metadata.name') | - reverse }}" + reverse | list }}" when: filtered_old_postgres_pods | length