From b7154cf2cfbc22695188f3e8ff59f64665cd3986 Mon Sep 17 00:00:00 2001 From: Matt Spaulding Date: Sun, 28 Jul 2013 14:16:25 -0700 Subject: [PATCH] Add tests for indexed_items lookup plugin --- test/lookup_plugins.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/lookup_plugins.yml b/test/lookup_plugins.yml index 7d2141cc0d..511e09b701 100644 --- a/test/lookup_plugins.yml +++ b/test/lookup_plugins.yml @@ -77,3 +77,28 @@ - name: cleanup test file, again action: file path=/tmp/ansible-test-with_password state=absent +# indexed_items lookup plugin + - name: create directory for indexed_items + file: path=/tmp/ansible-test-with_indexed_items-data state=directory + - name: test indexed_items + shell: echo "{{ item.0 }}" > /tmp/ansible-test-with_indexed_items-data/{{ item.1 }} + with_indexed_items: + - a + - b + - c + - name: check indexed_items content + shell: test -f /tmp/ansible-test-with_indexed_items-data/{{ item.1 }} && + test "{{ item.0 }}" = "$(cat /tmp/ansible-test-with_indexed_items-data/{{ item.1 }})" + with_indexed_items: + - a + - b + - c + - name: cleanup indexed_items test + file: path=/tmp/ansible-test-with_indexed_items-data/{{ item.1 }} state=absent + with_indexed_items: + - a + - b + - c + - name: remove with_indexed_items directory + file: path=/tmp/ansible-test-with_indexed_items-data state=absent +