From 5d434db7d9c2425eeb1bb437bf3149d89c7f413e Mon Sep 17 00:00:00 2001 From: Fabricio Aguiar Date: Tue, 3 Oct 2023 17:08:40 +0100 Subject: [PATCH] Speed up Ceph exclude task Signed-off-by: Fabricio Aguiar --- roles/edpm_container_manage/tasks/delete_orphan.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/roles/edpm_container_manage/tasks/delete_orphan.yml b/roles/edpm_container_manage/tasks/delete_orphan.yml index b1c0d69df..b0505e051 100644 --- a/roles/edpm_container_manage/tasks/delete_orphan.yml +++ b/roles/edpm_container_manage/tasks/delete_orphan.yml @@ -22,11 +22,7 @@ - name: Exclude Ceph containers from podman container list ansible.builtin.set_fact: - filtered_containers: "{{ filtered_containers | default([]) + [item] }}" - when: - - not (item['Name'] | regex_search('^ceph.*')) - loop: "{{ podman_containers.containers }}" - no_log: true + filtered_containers: "{{ podman_containers.containers | select('match', '^(?!.*(ceph))') | list }}" - name: "Delete orphan containers managed by Podman for {{ edpm_container_manage_config }}" when: