Commit 0f895740 authored by nanahira's avatar nanahira

supports for clouds

parent 94512cac
......@@ -6,7 +6,9 @@ source {{ansible_user_dir}}/nextgen-network/scripts/utility.sh
interface_switch_chnroute -D u_{{plan.name}}_chnroute {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
interface_switch_chnroute -D u_{{gw.isp}}_chnroute {{gw.selectionMark}}
{% endif %}
{% endfor %}
## all
......@@ -14,7 +16,9 @@ interface_switch_chnroute -D u_{{gw.isp}}_chnroute {{gw.selectionMark}}
interface_switch -D u_{{plan.name}}_all {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
interface_switch -D u_{{gw.isp}}_all {{gw.selectionMark}}
{% endif %}
{% endfor %}
## restore mark
......@@ -23,7 +27,9 @@ ip rule del pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}}
restore_mark_switch -D {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
restore_mark_switch -D {{gw.selectionMark}}
{% endif %}
{% endfor %}
true
......@@ -6,7 +6,10 @@ source {{ansible_user_dir}}/nextgen-network/scripts/utility.sh
interface_switch_chnroute -A u_{{plan.name}}_chnroute {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.mark > 0 %}
{% if gw.selectionMark > 0 %}
interface_switch_chnroute -A u_{{gw.isp}}_chnroute {{gw.selectionMark}}
{% endif %}
{% endfor %}
## all
......@@ -14,7 +17,9 @@ interface_switch_chnroute -A u_{{gw.isp}}_chnroute {{gw.selectionMark}}
interface_switch -A u_{{plan.name}}_all {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
interface_switch -A u_{{gw.isp}}_all {{gw.selectionMark}}
{% endif %}
{% endfor %}
## restore mark
......@@ -23,7 +28,9 @@ ip rule add pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}}
restore_mark_switch -A {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
restore_mark_switch -A {{gw.selectionMark}}
{% endif %}
{% endfor %}
true
......@@ -23,7 +23,12 @@ class InventoryBuilder {
async loadGateways() {
const gateways = await this.load('gateways2');
for (let gateway of gateways) {
gateway.selectionMark = gateway.mark + 50;
if (gateway.mark) {
gateway.selectionMark = gateway.mark + 50;
} else {
gateway.mark = 0;
gateway.selectionMark = 0;
}
}
return gateways;
}
......
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