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
This commit is contained in:
Mohammed Naser 2019-03-29 22:32:47 -04:00
parent c94cd6c4b6
commit 092d874e6f
2 changed files with 1 additions and 2 deletions

View File

@ -19,6 +19,7 @@
- import_tasks: "python_venv_wheel_build.yml"
run_once: yes
when: venv_wheel_build_enable | bool
tags:
- build

View File

@ -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: