ansible-ffibk/roles/network-meshbridge/templates/bridge.j2
Tobias Hachmer 63ca114c95 Migrate nested dictionary meshes into a list of dictionaries
- migrate dictionary `ipv6` into two simple lists
 - migrate dictionary `forward_zones` into a list
2017-10-06 22:58:00 +02:00

17 lines
663 B
Django/Jinja

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