- 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
        command: "{{ ansible_python_interpreter }} -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
            - import_tasks: test_template.yml
        when: is_native
