I am using a set_fact in a playbook to gather data using a regex_findall(). I\'m pulling out two groups with the regex and the ending result becomes a list of lists.
<You want to use with_list
instead of with_items
.
with_items
forcefully flattens nested lists, while with_list
feeds argument as is.
---
- hosts: localhost
gather_facts: no
vars:
nested_list: [[a,b],[c,d],[e,f],[g,h]]
tasks:
- debug: msg="{{ item[0] }} {{ item[1] }}"
with_list: "{{ nested_list }}"