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.
50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
- name: Test jinja2 native types
|
|
hosts: localhost
|
|
gather_facts: no
|
|
vars:
|
|
i_one: 1
|
|
i_two: 2
|
|
i_three: 3
|
|
s_one: "1"
|
|
s_two: "2"
|
|
s_three: "3"
|
|
dict_one:
|
|
foo: bar
|
|
baz: bang
|
|
dict_two:
|
|
bar: foo
|
|
foobar: barfoo
|
|
list_one:
|
|
- one
|
|
- two
|
|
list_two:
|
|
- three
|
|
- four
|
|
list_ints:
|
|
- 4
|
|
- 2
|
|
list_one_int:
|
|
- 1
|
|
b_true: True
|
|
b_false: False
|
|
s_true: "True"
|
|
s_false: "False"
|
|
yaml_none: ~
|
|
tasks:
|
|
- name: check jinja version
|
|
shell: python -c 'import jinja2; print(jinja2.__version__)'
|
|
register: jinja2_version
|
|
|
|
- name: make sure jinja is the right version
|
|
set_fact:
|
|
is_native: "{{ jinja2_version.stdout is version('2.10', '>=') }}"
|
|
|
|
- block:
|
|
- import_tasks: test_casting.yml
|
|
- import_tasks: test_concatentation.yml
|
|
- import_tasks: test_bool.yml
|
|
- import_tasks: test_dunder.yml
|
|
- import_tasks: test_types.yml
|
|
- import_tasks: test_none.yml
|
|
when: is_native
|