From 30757cd80f35a8e15f0b4d69a69435bc71d307a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw?= Date: Fri, 21 Feb 2020 08:14:44 +0100 Subject: [PATCH] Set the variable default if OS does not define the python --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 029788a..68c4bb1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- # For Python 3, use python3-pip. -pip_package: "{{ 'python-pip' if ansible_python_interpreter.endswith('python2') else 'python3-pip' }}" +pip_package: "{{ 'python-pip' if (ansible_python_interpreter| default('python3')).endswith('python2') else 'python3-pip' }}" pip_executable: "{{ 'pip3' if pip_package.startswith('python3') else 'pip' }}" pip_install_packages: []