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.
19 lines
623 B
YAML
19 lines
623 B
YAML
4 years ago
|
- when: lookup('pipe', ansible_playbook_python ~ ' -c "import jinja2; print(jinja2.__version__)"') is version('2.7', '>=')
|
||
|
block:
|
||
|
- set_fact:
|
||
|
names: '{{ things|map(attribute="name") }}'
|
||
|
vars:
|
||
|
things:
|
||
|
- name: one
|
||
|
- name: two
|
||
|
- notname: three
|
||
|
- name: four
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- '"%r"|format(undef) == "AnsibleUndefined"'
|
||
|
# The existence of AnsibleUndefined in a templating result
|
||
|
# prevents safe_eval from turning the value into a python object
|
||
|
- names is string
|
||
|
- '", AnsibleUndefined," in names'
|