--- - name: Install VXLAN configuration become: true template: src: templates/config.j2 dest: "/etc/network/interfaces.d/50-{{ item.name }}.conf" mode: 0644 when: item.type == "vxlan" loop: "{{ peers | flatten(levels=1) }}"