1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #9764 from bcoca/moar_tests

Moar tests
This commit is contained in:
Brian Coca 2014-12-11 01:03:54 -05:00
commit 1408a01498
3 changed files with 32 additions and 9 deletions

View file

@ -293,3 +293,7 @@
that:
- result.results|length == 3
- result.results[1].skipped
- name: test complex templated condition
debug: msg="it works"
when: vars_file_var in things1|union([vars_file_var])

View file

@ -111,9 +111,21 @@
- name: confirm pipe lookup works with a single positional arg
debug: msg="{{ lookup('pipe', 'ls') }}"
# https://github.com/ansible/ansible/issues/6550
- name: confirm pipe lookup works with multiple positional args
debug: msg="{{ lookup('pipe', 'ls -l /tmp') }}"
# LOOKUP TEMPLATING
- name: use bare interpolation
debug: msg="got {{item}}"
with_items: things1
register: bare_var
- name: verify that list was interpolated
assert:
that:
- "bare_var.results[0].item == 1"
- "bare_var.results[1].item == 2"
- name: use list with undefined var in it
debug: msg={{item}}
with_items: things2

View file

@ -2,4 +2,11 @@
# in general define test data in the individual role:
# roles/role_name/vars/main.yml
foo: "Hello"
things1:
- 1
- 2
things2:
- "{{ foo }}"
- "{{ foob }}"
vars_file_var: 321