Role service-bird: calculate peer addresses of other ansible managed hosts

This commit is contained in:
Julian Labus 2018-02-23 22:27:54 +01:00
parent d4d4ad0147
commit 004681b553
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
2 changed files with 18 additions and 2 deletions

View file

@ -2,11 +2,19 @@
# {{ ansible_managed }} # {{ ansible_managed }}
# #
{% for gateway in groups['ffmwu-gateways'] %}
{% if gateway != inventory_hostname %}
protocol bgp mwu_{{ gateway.rsplit('.freifunk-mwu.de')[0] }} from ibgp_mwu {
neighbor {{ bgp_ipv4_transfer_net | ipaddr('net') | ipaddr(hostvars[gateway]['magic']) | ipaddr('ip') }} as mwu_as;
};
{% endif %}
{% endfor %}
{% for item, value in bgp_mwu_servers.iteritems() %} {% for item, value in bgp_mwu_servers.iteritems() %}
{% if item != inventory_hostname_short %} {% if item != inventory_hostname_short %}
protocol bgp mwu_{{ item }} from ibgp_mwu { protocol bgp mwu_{{ item }} from ibgp_mwu {
neighbor {{ value.ipv4 }} as mwu_as; neighbor {{ value.ipv4 }} as mwu_as;
}; };
{% endif %}
{% endif %}
{% endfor %} {% endfor %}

View file

@ -2,11 +2,19 @@
# {{ ansible_managed }} # {{ ansible_managed }}
# #
{% for gateway in groups['ffmwu-gateways'] %}
{% if gateway != inventory_hostname %}
protocol bgp mwu_{{ gateway.rsplit('.freifunk-mwu.de')[0] }} from ibgp_mwu {
neighbor {{ bgp_ipv6_transfer_net | ipaddr('net') | ipsubnet(64, 0) | ipaddr(hostvars[gateway]['magic']) | ipaddr('ip') }} as mwu_as;
};
{% endif %}
{% endfor %}
{% for item, value in bgp_mwu_servers.iteritems() %} {% for item, value in bgp_mwu_servers.iteritems() %}
{% if item != inventory_hostname_short %} {% if item != inventory_hostname_short %}
protocol bgp mwu_{{ item }} from ibgp_mwu { protocol bgp mwu_{{ item }} from ibgp_mwu {
neighbor {{ value.ipv6 }} as mwu_as; neighbor {{ value.ipv6 }} as mwu_as;
}; };
{% endif %}
{% endif %}
{% endfor %} {% endfor %}