ansible-ffibk/roles/service-bird/templates/mwu_ipv4_peers.conf.j2
Tobias Hachmer e4e8c0998f
Introduce p2p vpn link between all ffmwu servers via WireGuard for routing purpose.
* add jinja2 extension 'jinja2.ext.do' to ansible.cfg
 * add host kichererbse.freifunk-mwu.de
 * add new server_type 'mesh-service' and new host group 'ffmwu-mesh-services'
 * use new loopback and anycast networks
 * add role wireguard
 * add role wireguard as dependency for roles network-routing + service-bird
 * add playbook 'mesh-services'
2019-03-19 15:23:12 +01:00

28 lines
777 B
Django/Jinja

#
# {{ ansible_managed }}
#
{% for network in my_wireguard_networks %}
protocol bgp mwu_{{ network.remote }} from ibgp_mwu {
{% if magic < network.remote_magic %}
source address {{ network.ipv4 | ipaddr('address') }};
neighbor {{ network.ipv4 | ipaddr('1') | ipaddr('address') }} as mwu_as;
{% else %}
source address {{ network.ipv4 | ipaddr('1') | ipaddr('address') }};
neighbor {{ network.ipv4 | ipaddr('address') }} as mwu_as;
{% endif %}
};
{% endfor %}
{% if server_type == 'gateway' %}
{% for item, value in bgp_legacy_servers.items() %}
{% if item != inventory_hostname_short %}
protocol bgp mwu_{{ item }}_legacy from ibgp_mwu {
source address mwu_address_legacy;
neighbor {{ value.ipv4 }} as mwu_as;
};
{% endif %}
{% endfor %}
{% endif %}