{{ ansible_managed | comment }}

source /etc/network/interfaces.d/*

#-----------------------------
# lo: loopback
#-----------------------------

auto lo
iface lo inet loopback
{% if network_interfaces_additional_loopback_ip_v4|d() %}
{% for ip in network_interfaces_additional_loopback_ip_v4 %}
  up /sbin/ip addr add {{ ip }} dev lo
  down /sbin/ip addr del {{ ip }} dev lo
{% endfor %}
{% endif -%}

iface lo inet6 loopback
{% if network_interfaces_additional_loopback_ip_v6|d() %}
{% for ip in network_interfaces_additional_loopback_ip_v6 %}
  up /sbin/ip addr add {{ ip }} dev lo
  down /sbin/ip addr del {{ ip }} dev lo
{% endfor %}
{% endif %}
