summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/lookup_indexed_items
diff options
context:
space:
mode:
authorMatt Clay <mclay@redhat.com>2020-02-12 03:00:01 +0100
committerGitHub <noreply@github.com>2020-02-12 03:00:01 +0100
commit9788daf13b62853f04e8bc2aa3ca2b778eb186e6 (patch)
treee70f90f7d3943a1311b6fbd4a0cbd6df989bfec5 /test/integration/targets/lookup_indexed_items
parentRename kubevirt inventory plugin test. (#67326) (diff)
downloadansible-9788daf13b62853f04e8bc2aa3ca2b778eb186e6.tar.xz
ansible-9788daf13b62853f04e8bc2aa3ca2b778eb186e6.zip
Split up more lookup integration tests. (#67328)
Diffstat (limited to 'test/integration/targets/lookup_indexed_items')
-rw-r--r--test/integration/targets/lookup_indexed_items/aliases2
-rw-r--r--test/integration/targets/lookup_indexed_items/tasks/main.yml16
2 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/targets/lookup_indexed_items/aliases b/test/integration/targets/lookup_indexed_items/aliases
new file mode 100644
index 0000000000..ed821c2754
--- /dev/null
+++ b/test/integration/targets/lookup_indexed_items/aliases
@@ -0,0 +1,2 @@
+shippable/posix/group2
+skip/aix
diff --git a/test/integration/targets/lookup_indexed_items/tasks/main.yml b/test/integration/targets/lookup_indexed_items/tasks/main.yml
new file mode 100644
index 0000000000..84f5fbce97
--- /dev/null
+++ b/test/integration/targets/lookup_indexed_items/tasks/main.yml
@@ -0,0 +1,16 @@
+- name: create unindexed list
+ shell: for i in $(seq 1 5); do echo "x" ; done;
+ register: list_data
+
+- name: create indexed list
+ set_fact: "{{ item[1] + item[0]|string }}=set"
+ with_indexed_items: "{{list_data.stdout_lines}}"
+
+- name: verify with_indexed_items result
+ assert:
+ that:
+ - "x0 == 'set'"
+ - "x1 == 'set'"
+ - "x2 == 'set'"
+ - "x3 == 'set'"
+ - "x4 == 'set'"