mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add tests for indexed_items lookup plugin
This commit is contained in:
parent
5d15515bbf
commit
b7154cf2cf
1 changed files with 25 additions and 0 deletions
|
@ -77,3 +77,28 @@
|
||||||
- name: cleanup test file, again
|
- name: cleanup test file, again
|
||||||
action: file path=/tmp/ansible-test-with_password state=absent
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue