From a8fb6f0958704c2f6d5b1be776423dc6263a82cf Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 19 Jan 2017 10:54:26 -0800 Subject: [PATCH] Use jinja2 import instead of pip to get version. This resolves issues with older versions of pip. --- test/integration/targets/filters/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/targets/filters/tasks/main.yml b/test/integration/targets/filters/tasks/main.yml index 3558c4e2938..8075d91c66b 100644 --- a/test/integration/targets/filters/tasks/main.yml +++ b/test/integration/targets/filters/tasks/main.yml @@ -112,7 +112,7 @@ - "'local' == ['localhost']|map('extract',hostvars,'ansible_connection')|list|first" - "'local' == ['localhost']|map('extract',hostvars,['ansible_connection'])|list|first" # map was added to jinja2 in version 2.7 - when: "{{ ( lookup('pipe', 'pip show --disable-pip-version-check jinja2 | grep ^Version: | sed \"s/^Version: //\"') | + when: "{{ ( lookup('pipe', '{{ ansible_python[\"executable\"] }} -c \"import jinja2; print(jinja2.__version__)\"') | version_compare('2.7', '>=') ) }}" - name: Test json_query filter