Commit bfde8ee4 authored by nanahira's avatar nanahira

use fixed metric

parent 0a576052
...@@ -67,12 +67,8 @@ protocol ospf v2 { ...@@ -67,12 +67,8 @@ protocol ospf v2 {
# hello 5; # Default hello perid 10 is too long # hello 5; # Default hello perid 10 is too long
# }; # };
{% for connection in connections %} {% for connection in connections %}
{% if connection.protocol != "null" and connection.remoteLocalAddress != address %} {% if connection.protocol != "null" and not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
{% if connection.protocol == "oc" and connection.ocType == "server" %}
interface "{{connection.name}}*" {
{% else %}
interface "{{connection.name}}" { interface "{{connection.name}}" {
{% endif %}
type ptmp; type ptmp;
{% if connection.outbound %} {% if connection.outbound %}
cost {{connection.metric}}; cost {{connection.metric}};
...@@ -86,6 +82,16 @@ protocol ospf v2 { ...@@ -86,6 +82,16 @@ protocol ospf v2 {
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if ocservNeeded %}
interface "mcoc*" {
type ptmp;
cost {{ocMetric}};
hello 5;
authentication cryptographic;
password "{{ospfToken}}";
};
{% endif %}
{% for interface in lanInterfaces %} {% for interface in lanInterfaces %}
interface "{{interface}}" { interface "{{interface}}" {
type broadcast; type broadcast;
......
...@@ -202,6 +202,7 @@ class InventoryBuilder { ...@@ -202,6 +202,7 @@ class InventoryBuilder {
ocservNeeded: host.ocservNeeded || false, ocservNeeded: host.ocservNeeded || false,
ocservPort: host.ocservPort, ocservPort: host.ocservPort,
ocservCert: host.ocservCert || null, ocservCert: host.ocservCert || null,
ocMetric: host.ocMetric || null;
ocpasswdLines: host.ocpasswdLines || [], ocpasswdLines: host.ocpasswdLines || [],
gateways: _.values(this.gateways[host.name]), gateways: _.values(this.gateways[host.name]),
connections, connections,
...@@ -280,6 +281,7 @@ class InventoryBuilder { ...@@ -280,6 +281,7 @@ class InventoryBuilder {
if (!local.dockerServices.services.ocserv) { if (!local.dockerServices.services.ocserv) {
local.ocservNeeded = true; local.ocservNeeded = true;
local.ocpasswdLines = []; local.ocpasswdLines = [];
local.ocMetric = metric;
local.dockerServices.services.ocserv = { local.dockerServices.services.ocserv = {
restart: 'always', restart: 'always',
image: 'git-registry.mycard.moe/nanahira/docker-ocserv', image: 'git-registry.mycard.moe/nanahira/docker-ocserv',
......
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