From 831e6f6f662ab764812dec53f4d00659c7710e64 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 7 Jul 2020 18:23:01 -0400 Subject: [PATCH] tripleo_container_manage: only run exec/create playbooks when needed Only run these playbooks when there are some containers to manage with exec/create actions. Change-Id: I40a75a14a5bb4e898229b6f2306bf4a784f26cf7 (cherry picked from commit 636d7c1759666699e975c1bd04049c581e4a5fe3) --- .../roles/tripleo_container_manage/tasks/podman/manage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/manage.yml b/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/manage.yml index 9515642cb..eb82ec59b 100644 --- a/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/manage.yml +++ b/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/manage.yml @@ -16,6 +16,10 @@ - name: Run containers execs asynchronously include_tasks: podman/exec.yml + when: + - ((batched_container_data | haskey(attribute='action', value='exec') | default([])) | length > 0) - name: Manage containers asynchronously include_tasks: podman/create.yml + when: + - ((batched_container_data | haskey(attribute='action', reverse=True) | default([])) | length > 0)