community / community.general / 3.8.10 / lookup / flattened return single list completely flattened Authors: Serge van Ginderachter (!UNKNOWN) <serge@vanginderachter.be>community.general.flattened (3.8.10) — lookup
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
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" ansible.builtin.debug: msg: "all in one list {{lookup('community.general.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