mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
297 B
YAML
16 lines
297 B
YAML
4 years ago
|
- hosts: localhost
|
||
|
gather_facts: no
|
||
|
vars:
|
||
|
foo: []
|
||
|
bar: "{{ foo[0] }}"
|
||
|
tasks:
|
||
|
- debug:
|
||
|
msg: "{{ bar }}"
|
||
|
register: result
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- '"foo[0]" in result.msg'
|
||
|
- '"object has no element 0" in result.msg'
|