ansible-ffibk/roles/network-meshbridge/templates/bridge.j2

16 lines
711 B
Text
Raw Normal View History

{% set ip4hex = item.value.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') | ip4_hex() -%}
{% set mac = '0210' + ip4hex -%}
#
# {{ ansible_managed }}
#
auto {{ item.key }}BR
iface {{ item.key }}BR
hwaddress {{ mac | hwaddr('linux') }}
address {{ item.value.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') }}/{{ item.value.ipv4_network | ipaddr('net') | ipaddr('prefix') }}
{% for ip_type, ip_list in item.value.ipv6.iteritems() %}
{% for ip in ip_list %}
address {{ ip | ipaddr('net') | ipsubnet(64, 0) | ipaddr(magic) | ipaddr('address') }}/{{ ip | ipaddr('net') | ipsubnet(64, 0) | ipaddr('prefix') }}
{% endfor %}
{% endfor %}
bridge-ports {{ item.key }}BAT