35 lines
1.1 KiB
Django/Jinja
35 lines
1.1 KiB
Django/Jinja
{{ ansible_header | comment }}
|
|
|
|
{% set switch = hostvars[inventory_hostname]['ansible_' + switch_iface.stdout] %}
|
|
allow-hotplug {{ switch_iface.stdout }}
|
|
iface {{ switch_iface.stdout }} inet static
|
|
address {{ switch.ipv4.address }}
|
|
network {{ switch.ipv4.network }}
|
|
netmask {{ switch.ipv4.netmask }}
|
|
broadcast {{ switch.ipv4.broadcast }}
|
|
mtu 1496
|
|
dns-nameservers {{ switch_dns }}
|
|
dns-search switch.crans.org
|
|
up /sbin/ip link set $IFACE alias switch
|
|
{% if 'interfaces' in ansible_local %}
|
|
{% if 'sup_if_4' in ansible_local.interfaces %}
|
|
{% if switch_iface.stdout in ansible_local.interfaces.sup_if_4 %}
|
|
{% for line in ansible_local.interfaces.sup_if_4[switch_iface.stdout] %}
|
|
{{ line }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
iface {{ switch_iface.stdout }} inet6 static
|
|
address {{ switch.ipv6[0].address }}/{{ switch.ipv6[0].prefix }}
|
|
{% if 'interfaces' in ansible_local %}
|
|
{% if 'sup_if_6' in ansible_local.interfaces %}
|
|
{% if switch_iface.stdout in ansible_local.interfaces.sup_if_6 %}
|
|
{% for line in ansible_local.interfaces.sup_if_6[switch_iface.stdout] %}
|
|
{{ line }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|