ansible / ansible.builtin / v2.9.17 / lookup / flattened return single list completely flattened | "added in version" 1.3 of ansible.builtin" Authors: Serge van Ginderachter <serge@vanginderachter.be>ansible.builtin.flattened (v2.9.17) — lookup
pip
Install with pip install ansible==2.9.17
given one or more lists, this lookup will flatten any list elements found recursively until only 1 list is left.
- name: "'unnest' all elements into single list" debug: msg="all in one list {{lookup('flattened', [1,2,3,[5,6]], [a,b,c], [[5,6,1,3], [34,a,b,c]])}}"
_terms: description: lists to flatten required: true
_raw: description: - flattened list type: list