- set_fact:
    loopback_ip: "{{ interfaces[ansible_hostname].loopback }}"
    unnmumbered: "{{ interfaces[ansible_hostname].int_unnumbered }}"
    bridges: "{{ interfaces[ansible_hostname].bridges }}"

- name: configure loopback interface
  cl_interface:
    name: 'lo'
    addr_method: 'loopback'
    ipv4: '{{ loopback_ip }}/32'
  notify: reload networking
  when: loopback_ip is defined

- name: configure managment interface
  cl_interface:
    name: 'eth0'
    addr_method: 'dhcp'

- name: configure unnumbered interfaces
  cl_interface:
    name: '{{ item }}'
    ipv4: '{{ loopback_ip}}/32'
    with_items: unnumbered
    when: unnumbered is defined

- set_fact:
    loopback_ip: "{{ interfaces[ansible_hostname].loopback }}"
    unnumbered: "{{ interfaces[ansible_hostname].int_unnumbered }}"
    bridges: "{{ interfaces[ansible_hostname].bridges }}"

- name: configure loopback interface
  cl_interface:
    name: 'lo'
    addr_method: 'loopback'
    ipv4: '{{ loopback_ip }}/32'
  notify: reload networking
  when: loopback_ip is defined

- name: configure managment interface
  cl_interface:
    name: 'eth0'
    addr_method: 'dhcp'

- name: configure unnumbered interfaces
  cl_interface:
    name: '{{ item }}'
    ipv4: '{{ loopback_ip}}/32'
  with_items: unnumbered
  when: unnumbered is defined

- name: configure bridges
  cl_interface:
    name: "{{ item.bridgename }}"
    ipv4: "{{ item.ip_and_mask }}"
    bridge_ports: "{{ item.members|join(' ') }}"
    mstpctl_stp: true
  with_items: bridges
  when: bridges is defined

Fix unnumbered & add bridges
Fix unnumbered & add bridges

Fix the with_items & when clauses on unnumbered interfaces
Add bridges
