ansible-ffibk/roles/network-batman/templates/batman.j2

15 lines
667 B
Text
Raw Normal View History

{% set ip4hex = item.value.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') | ip4_hex() -%}
{% set mac = '0201' + ip4hex -%}
#
# {{ ansible_managed }}
#
auto {{ item.key }}BAT
iface {{ item.key }}BAT
hwaddress {{ mac | hwaddr('linux') }}
batman-ifaces {{ item.key }}0 {{ item.key }}VPN {{ item.key }}igVPN
batman-hop-penalty {{ item.value.batman.hop_penalty }}
post-up /usr/sbin/batctl -m $IFACE it {{ item.value.batman.it }}
post-up /usr/sbin/batctl -m $IFACE gw {{ item.value.batman.gw }}
post-up /usr/sbin/batctl -m $IFACE mm {{ item.value.batman.mm }}
post-up /usr/sbin/batctl -m $IFACE dat {{ item.value.batman.dat }}