From d370c590b35ea807bcef43c20952845c68498530 Mon Sep 17 00:00:00 2001 From: Guillaume Chauvel Date: Fri, 29 May 2020 22:17:57 +0200 Subject: [PATCH] ensure-twine: Check executable presence using shell+bin/bash While making test with a node: - with tox installed using "pip install --user" as a non-root user - PATH modified using ~/.ssh/environment - declared in nodepool to run as this non-root user twine executable is not found: using "command": twine is not found using "shell" without /bin/bash: twine is not found using "shell" with /bin/bash: twine is found! Change-Id: Ia06218a830b5d44f04e0f10e0444be2cf9ad682e --- roles/ensure-twine/tasks/main.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/ensure-twine/tasks/main.yaml b/roles/ensure-twine/tasks/main.yaml index 8d966908d..4d166b65b 100644 --- a/roles/ensure-twine/tasks/main.yaml +++ b/roles/ensure-twine/tasks/main.yaml @@ -1,5 +1,8 @@ - name: Check for twine install - command: which twine + shell: | + command -v {{ twine_executable }} || exit 1 + args: + executable: /bin/bash failed_when: false register: register_twine