bird: add flag $gw_do_ic_peering

This commit is contained in:
Martin Schuette 2014-04-01 00:05:53 +02:00
parent fd78f0bdfc
commit 303d8fd785
3 changed files with 21 additions and 4 deletions

View file

@ -1,4 +1,4 @@
class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcprange_end) { class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcprange_end, $gw_do_ic_peering = false) {
class { 'ff_gw::apt': } class { 'ff_gw::apt': }
-> ->
class { 'ff_gw::software': } class { 'ff_gw::software': }
@ -27,8 +27,9 @@ class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcpr
class { 'ff_gw::dnsmasq': } class { 'ff_gw::dnsmasq': }
-> ->
class { 'ff_gw::bird': class { 'ff_gw::bird':
own_ipv4 => $gw_ipv4, own_ipv4 => $gw_ipv4,
own_ipv6 => $gw_ipv6, own_ipv6 => $gw_ipv6,
gw_do_ic_peering => $gw_do_ic_peering,
} }
} }
@ -419,7 +420,7 @@ exit 0';
} }
} }
class ff_gw::bird($own_ipv4, $own_ipv6, $version = 'present') { class ff_gw::bird($own_ipv4, $own_ipv6, $gw_do_ic_peering, $version = 'present') {
# read peering data from data file # read peering data from data file
$module_path = get_module_path($module_name) $module_path = get_module_path($module_name)
$peeringdata = loadyaml("${module_path}/data/peering.yaml") $peeringdata = loadyaml("${module_path}/data/peering.yaml")

View file

@ -141,3 +141,11 @@ protocol bgp <%= key %> from <%= hash["template"] %> {
neighbor <%= hash["ip"] %> as <%= hash["as"] %>; neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
}; };
<% end -%><% end -%> <% end -%><% end -%>
<% if @gw_do_ic_peering -%>
<% @ic_peerings_v4.each_pair do |key, hash| -%><% if hash["ip"] != @own_ipv4 -%>
protocol bgp <%= key %> from <%= hash["template"] %> {
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
};
<% end -%><% end -%>
<% end -%>

View file

@ -77,3 +77,11 @@ protocol bgp <%= key %> from <%= hash["template"] %> {
neighbor <%= hash["ip"] %> as <%= hash["as"] %>; neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
}; };
<% end -%><% end -%> <% end -%><% end -%>
<% if @gw_do_ic_peering -%>
<% @ic_peerings_v6.each_pair do |key, hash| -%><% if hash["ip"] != @own_ipv6 -%>
protocol bgp <%= key %> from <%= hash["template"] %> {
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
};
<% end -%><% end -%>
<% end -%>