From ad652746437b4e7d225a9725a501ca1cdfd07969 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 --- test/integration/targets/filters/tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/targets/filters/tasks/main.yml b/test/integration/targets/filters/tasks/main.yml index a6f0f4f74d..3558c4e293 100644 --- a/test/integration/targets/filters/tasks/main.yml +++ b/test/integration/targets/filters/tasks/main.yml @@ -111,6 +111,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: