Commit 580f00b8 authored by nanahira's avatar nanahira

finish gateway

parent d487d863
...@@ -32,12 +32,10 @@ protocol kernel { ...@@ -32,12 +32,10 @@ protocol kernel {
{% for plan in routePlans %} {% for plan in routePlans %}
ipv4 table {{plan.name}}; ipv4 table {{plan.name}};
protocol static { protocol pipe {
ipv4 { table master4;
table {{plan.name}}; peer table {{plan.name}};
}; export where ospf_router_id ~ {{plan.addressesString}};
igp table master4;
route 0.0.0.0/0 recursive {{plan.addresses[0]}};
} }
protocol kernel { protocol kernel {
ipv4 { ipv4 {
......
...@@ -118,6 +118,9 @@ class InventoryBuilder { ...@@ -118,6 +118,9 @@ class InventoryBuilder {
return vars; return vars;
} }
getRoutePlanAddressesString(addresses: string[]) {
return `[ ${addresses.join(", ")} ]`;
}
async host_vars(host) { async host_vars(host) {
const connections = []; const connections = [];
host.dockerServices = { host.dockerServices = {
...@@ -157,7 +160,8 @@ class InventoryBuilder { ...@@ -157,7 +160,8 @@ class InventoryBuilder {
routePlans.push({ routePlans.push({
name: h.replace(/-/g, "_"), name: h.replace(/-/g, "_"),
destMark: this.hosts[h].destMark, destMark: this.hosts[h].destMark,
addresses: [this.hosts[h].address] addresses: [this.hosts[h].address],
addressesString: this.getRoutePlanAddressesString([this.hosts[h].address])
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment