From b2942f108461ef9d4e4dc8322a83b55ae258253f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 16 Jan 2017 13:16:51 -0800 Subject: [PATCH] Only test map on jinja2 >= 2.7 (cherry picked from commit ad652746437b4e7d225a9725a501ca1cdfd07969) --- test/integration/roles/test_filters/tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/roles/test_filters/tasks/main.yml b/test/integration/roles/test_filters/tasks/main.yml index 03566220e5..e43b95eac2 100644 --- a/test/integration/roles/test_filters/tasks/main.yml +++ b/test/integration/roles/test_filters/tasks/main.yml @@ -104,6 +104,9 @@ - "31 == ['x','y']|map('extract',{'x':42,'y':31})|list|last" - "'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: //\"') | + version_compare('2.7', '>=') ) }}" - name: Test json_query filter assert: