# # !!! This file is managed by Ansible !!! # {% for interface in network.interfaces %} auto {{ interface.name }} {% if interface.loopback is defined %} iface {{ interface.name }} inet loopback {% elif interface.manual is defined %} iface {{ interface.name }} inet manual {% else %} {% if interface.ipv4.dhcp is defined %} iface {{ interface.name }} inet dhcp {% else %} iface {{ interface.name }} inet static {% if system.hostname is defined %} hostname {{ system.hostname }} {% endif %} {% if interface.bridge_ports is defined %} bridge-ports {{interface.bridge_ports}} {% endif %} {% if interface.bridge_stp is defined %} {% if interface.bridge_stp is true %} bridge-stp 1 {% else %} bridge-stp 0 {% endif %} {% endif %} {% if interface.ipv4.address is defined %} address {{ interface.ipv4.address }} {% endif %} {% if interface.ipv4.netmask is defined %} netmask {{ interface.ipv4.netmask }} {% endif %} {% if interface.ipv4.gateway is defined %} gateway {{ interface.ipv4.gateway }} {% endif %} {% if interface.pre_up is defined %} {% for command in inteface.pre_up %} pre-up {{ command }} {% endfor %} {% endif %} {% if interface.post_up is defined %} {% for command in inteface.post_up %} post-up {{ command }} {% endfor %} {% endif %} {% if interface.post_down is defined %} {% for command in inteface.post_down %} post-down {{ command }} {% endfor %} {% endif %} {% endif %} {% if interface.ipv6 is defined %} {% if interface.ipv6.stateless is defined %} iface {{ interface.name }} inet6 manual pre-up echo 1 > /proc/sys/net/ipv6/conf/eth0/accept_ra {% else %} iface {{ interface.name }} inet6 static {% if system.hostname is defined %} hostname {{ system.hostname }} {% endif %} {% if interface.ipv6.address is defined %} address {{ interface.ipv6.address }} {% endif %} {% if interface.ipv6.netmask is defined %} netmask {{ interface.ipv6.netmask }} {% endif %} {% if interface.ipv6.gateway is defined %} gateway {{ interface.ipv6.gateway }} {% endif %} {% if interface.pre_up is defined %} {% for command in inteface.pre_up %} pre-up {{ command }} {% endfor %} {% endif %} {% if interface.post_up is defined %} {% for command in inteface.post_up %} post-up {{ command }} {% endfor %} {% endif %} {% if interface.post_down is defined %} {% for command in inteface.post_down %} post-down {{ command }} {% endfor %} {% endif %} {% endif %} {% endif %} {% endif %} {% endfor %}