Will this do what you need?  using structure[list] instead of trying to 
nest.

---
- name: stuff
  connection: local
  gather_facts: no
  hosts: localhost

  vars:
    list: list1
    structure:
      list1:
        - {var1: "val1", var2: "val2", var3: "val3"}
      list2:
        - {var1: "val1", var2: "val2", var3: "val3"}
      list3:
        - {var1: "val1", var2: "val2", var3: "val3"}


  tasks:
  - name: with_index
    debug: msg="var1={{item.var1}}, var2={{item.var2}}, var3={{item.var3}}"
    with_items:
      - "{{structure[list]}}"



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/77770486-406d-438f-95a5-4deed0a5fd2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to