summaryrefslogtreecommitdiff
path: root/test/integration/targets/filters
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2017-01-16 12:57:45 -0800
committerToshio Kuratomi <a.badger@gmail.com>2017-01-16 13:13:34 -0800
commit32fbd4ba24d1bdfc40b121277f3e50f6c1237539 (patch)
treee80e0d5a80d1ba72e55583dad56dbf04a62d1433 /test/integration/targets/filters
parente2bd71ac0229375b584df3d9f8c23466a90f2570 (diff)
downloadansible-32fbd4ba24d1bdfc40b121277f3e50f6c1237539.tar.gz
Test the extract filter without the map filter.
map + extract is the usual way to use it but map isn't available on older versions of jinja2 that we still work with. Test extract even on those versions.
Diffstat (limited to 'test/integration/targets/filters')
-rw-r--r--test/integration/targets/filters/tasks/main.yml7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/integration/targets/filters/tasks/main.yml b/test/integration/targets/filters/tasks/main.yml
index fce05c0c21..a6f0f4f74d 100644
--- a/test/integration/targets/filters/tasks/main.yml
+++ b/test/integration/targets/filters/tasks/main.yml
@@ -95,6 +95,13 @@
assert:
that: "{{_.failed}}"
+- name: Test extract
+ assert:
+ that:
+ - '"c" == 2 | extract(["a", "b", "c"])'
+ - '"b" == 1 | extract(["a", "b", "c"])'
+ - '"a" == 0 | extract(["a", "b", "c"])'
+
- name: Container lookups with extract
assert:
that: