Commit bfde8ee4 authored by nanahira's avatar nanahira

use fixed metric

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