ansible-ffibk/roles/service-fastd-intragate/templates/fastd-intragate.conf.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

37 lines
920 B
Django/Jinja

{% set ip4hex = item.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') | ip4_hex() -%}
{% set mac = '0212' + ip4hex -%}
#
# {{ ansible_managed }}
#
log level warn;
hide ip addresses yes;
hide mac addresses yes;
method "aes128-ctr+umac";
interface "{{ item.id }}igVPN";
bind {{ ansible_default_ipv4.address | ipaddr('public') }}:101{{ item.site_number }};
bind {{ ansible_default_ipv6.address | ipaddr('public') | ipwrap }}:101{{ item.site_number }};
include "secret.conf";
mtu 1406;
peer group "servers" {
include peers from "peers/gates";
include peers from "peers/services";
}
on up "
ip link set $INTERFACE down
ip link set address {{ mac | hwaddr('linux') }} dev $INTERFACE
ip link set $INTERFACE up
batctl -m {{ item.id }}BAT if add $INTERFACE
";
on down "
batctl -m {{ item.id }}BAT if del $INTERFACE
";
status socket "/var/run/fastd-{{ item.id }}igVPN.status";