From 799b180e2d6b96e1cc3289096fda0b4a0fdd5956 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 6d75c0d81cf..2899cc4a77b 100644 --- a/test/integration/roles/test_filters/tasks/main.yml +++ b/test/integration/roles/test_filters/tasks/main.yml @@ -77,3 +77,6 @@ - "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', '>=') ) }}"