From f4b1c94de9be8d16f55e4b45e5f4873b06d7e1c2 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Fri, 16 Aug 2019 18:37:26 +0100 Subject: [PATCH] Do not use a role scoped variable for role include condition The var tempest_plugin_install_source is defined within the os_tempest role so if it is used in the condition that includes the python_venv_build role, it must be in scope for the python venv build handler which runs in the outer containing playbook, and this fails with a var not found error. Change-Id: I7d1fd3b7d06d3a0c6d86750ed36cbe858190f87e --- tasks/tempest_install_source.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/tempest_install_source.yml b/tasks/tempest_install_source.yml index 0b542ae5..212ac56e 100644 --- a/tasks/tempest_install_source.yml +++ b/tasks/tempest_install_source.yml @@ -28,7 +28,11 @@ - section: "tempest" option: "venv_tag" value: "{{ tempest_venv_tag }}" - when: not tempest_plugin_install_source + # Note(jrosser) this task can be conditional on tempest_plugin_install_source + # but then that variable must be in scope when the handler inside python_venv_build + # runs, so it is better to duplicate the underlying condition logic + # when: not tempest_plugin_install_source + when: not "{{ ((tempest_install_method | default('source') == 'distro') and (ansible_os_family | lower == 'debian')) | bool }}" - name: Get tempest plugins from git git: