From 09b4be329e93f20983bccd6e734e7b774a50dd8e Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Fri, 10 Jul 2020 11:24:27 -0500 Subject: [PATCH] Strip path from default ensure_pip_from_upstream_interpreters The ensure-pip role has an option to provide multiple interpreters to use. If not specified, we default to ansible_python.executable. This default includes the full path to the executable. Those manually providing which interpreters to use will not know what the full path is, only the versions they would like to use. To make things consistent, this strips off the path so we just have the version (python, python3, python3.8, etc). Change-Id: I339afc08393e9c6b1d26a05cf13b6fdc151f46d5 Signed-off-by: Sean McGinnis --- roles/ensure-pip/defaults/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ensure-pip/defaults/main.yaml b/roles/ensure-pip/defaults/main.yaml index 103e1ff96..f55233b0d 100644 --- a/roles/ensure-pip/defaults/main.yaml +++ b/roles/ensure-pip/defaults/main.yaml @@ -3,4 +3,4 @@ ensure_pip_from_packages_with_python2: '{{ (ansible_python.version.major == 2) | ensure_pip_from_upstream_url: 'https://bootstrap.pypa.io/get-pip.py' ensure_pip_from_upstream: False ensure_pip_from_upstream_interpreters: - - '{{ ansible_python.executable }}' + - '{{ ansible_python.executable | regex_replace(".*python", "python") }}'