From 092d874e6fe78937a308b686b56b835cc3bf23ea Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 29 Mar 2019 22:32:47 -0400 Subject: [PATCH] speedup: move when block to outside include Instead of including a file, then running a conditional in the block which gets applied inside the task, which then results in every task running, but getting skipped (especially in scenarios where the build host is the same as the current one), we simply include if we have to. This saves around 20 seconds in every iteration of python_venv_build on metal. Change-Id: I8afb2970ee696f0fe9a9e250f19f1db465d63511 --- tasks/main.yml | 1 + tasks/python_venv_wheel_build.yml | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 69ef048..a8b3262 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,6 +19,7 @@ - import_tasks: "python_venv_wheel_build.yml" run_once: yes + when: venv_wheel_build_enable | bool tags: - build diff --git a/tasks/python_venv_wheel_build.yml b/tasks/python_venv_wheel_build.yml index d1f5c25..e460eaa 100644 --- a/tasks/python_venv_wheel_build.yml +++ b/tasks/python_venv_wheel_build.yml @@ -16,8 +16,6 @@ - name: Build the wheels on the build host delegate_to: "{{ venv_build_host }}" become: "{{ venv_build_host == 'localhost' }}" - when: - - venv_wheel_build_enable | bool block: - name: Install distro packages for wheel build package: