DEV Community

Roy
Roy

Posted on

Answer: Ansible with_subelements

This is really bad example of how subelements lookup works. (And has old, unsupported, syntax as well).

Look at this one:

---
- hosts: localhost
  gather_facts: no
  vars:
    families:
      - surname: Smith
        children:
          - name: Mike
            age: 4
          - name: Kate
            age: 7
      - surname: Sanders
        children:
          - name: Pete

Top comments (0)