On Fri, 6 Mar 2020 09:15:51 -0800 (PST)
Quentin Aveno <
aori...@gmail.com> wrote:
> - name: test
> vars:
> test1: "test1"
> test2:
> - "test21"
> - "test22"
> test3:
> - "{{ test1 }}"
> - "{{ test2 }}"
>
> debug:
> msg: "{% for tt in test3 %} {{ tt }} {% endfor %}"
>
> Is there a way to flatten the list into à list of strings with a filter ?
Use filter "flatten". For example
- debug:
msg: "{{ test3|flatten }}"
should give
"msg": [
"test1",
"test21",
"test22"
]
HTH,
-vlado