Commit 3ed649e1 authored by nanahira's avatar nanahira

put null connections away

parent 00e2129d
# force reload 6.14
{% for connection in connections %}
{% if connection.protocol != "null" and not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
{% if not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
{% if connection.inbound %}
interface {{connection.name}} type tunnel rxcost {{connection.metric}} faraway true link-quality true
{% else %}
......
......@@ -19,7 +19,7 @@ local-port-readwrite 33123
#in deny
{% for connection in connections %}
{% if connection.protocol != "null" and not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
{% if not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
{% if connection.inbound %}
interface {{connection.name}} type tunnel rxcost {{connection.metric}} faraway true link-quality true
{% else %}
......
......@@ -27,7 +27,7 @@ protocol kernel {
}
{% for connection in connections %}
{% if connection.protocol != "null" and connection.remoteLocalAddress != address %}
{% if connection.remoteLocalAddress != address %}
ipv4 table {{connection.name.replace("-", "_")}};
protocol static {
ipv4 {
......@@ -82,7 +82,7 @@ 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.remoteLocalAddress != address %}
interface "{{connection.name}}" {
type ptp;
{% if connection.outbound %}
......
......@@ -99,14 +99,14 @@
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
loop: '{{ connections }}'
when: "not noUpdateLinks and item.protocol is defined and item.protocol == 'null' and not item.noUpdate"
loop: '{{ nullConnections }}'
when: "not noUpdateLinks and item.protocol is defined and not item.noUpdate"
- name: 'loop through list from a variable'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
loop: '{{ connections }}'
when: "not noUpdateLinks and item.protocol is defined and item.protocol != 'null' and not item.noUpdate"
when: "not noUpdateLinks and item.protocol is defined and not item.noUpdate"
# end
- name: services conf
copy:
......
......@@ -288,6 +288,7 @@ class InventoryBuilder {
async host_vars(host: CommonEntry) {
const connections = [];
const nullConnections = [];
host.dockerServices = {
version: '2.4',
services: {
......@@ -388,11 +389,11 @@ class InventoryBuilder {
// 对称连接
const connectionString = from || to;
connections.push(await this.parse_connection(host, this.hosts[h], connectionString, true, true, connectionString === from));
connections.push(await this.parse_connection(host, this.hosts[h], null_connection, false, false, false));
nullConnections.push(await this.parse_connection(host, this.hosts[h], null_connection, false, false, false));
} else {
// 不连接
connections.push(await this.parse_connection(host, this.hosts[h], null_connection, true, false, false));
connections.push(await this.parse_connection(host, this.hosts[h], null_connection, false, true, false));
nullConnections.push(await this.parse_connection(host, this.hosts[h], null_connection, true, false, false));
nullConnections.push(await this.parse_connection(host, this.hosts[h], null_connection, false, true, false));
}
const targetHost = this.hosts[h];
routePlans.push({
......@@ -424,6 +425,7 @@ class InventoryBuilder {
ocpasswdLines: host.ocpasswdLines || [],
gateways: _.values(this.gateways[host.name]),
connections,
nullConnections,
lanInterfaces,
localSubnets,
masqInterfaces,
......
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