Page MenuHomeDevCentral

D2331.id.diff
No OneTemporary

D2331.id.diff

diff --git a/pillar/nodes/nodes.sls b/pillar/nodes/nodes.sls
--- a/pillar/nodes/nodes.sls
+++ b/pillar/nodes/nodes.sls
@@ -74,8 +74,11 @@
roles:
- router
network:
+ ipv4_interface: vmx0
ipv4_address: 51.255.124.8
+ ipv4_netmask: 255.255.255.255
ipv4_gateway: 91.121.86.254
+ ipv4_ovh_failover: True
ipv6_tunnel: False
diff --git a/roles/core/network/files/FreeBSD/routing_ipv4.rc b/roles/core/network/files/FreeBSD/routing_ipv4.rc
--- a/roles/core/network/files/FreeBSD/routing_ipv4.rc
+++ b/roles/core/network/files/FreeBSD/routing_ipv4.rc
@@ -13,4 +13,10 @@
# and will be lost if the state is redeployed.
# </auto-generated>
+{% if ipv4_ovh_failover %}
+static_routes="net1 net2"
+route_net1="-net {{ ipv4_gateway }}/32 -interface {{ ipv4_interface }}"
+route_net2="default {{ ipv4_gateway }}"
+{% else %}
defaultrouter="{{ ipv4_gateway }}"
+{% endif %}
diff --git a/roles/core/network/ipv4.sls b/roles/core/network/ipv4.sls
--- a/roles/core/network/ipv4.sls
+++ b/roles/core/network/ipv4.sls
@@ -38,4 +38,6 @@
- template: jinja
- context:
ipv4_gateway: {{ network['ipv4_gateway'] }}
+ ipv4_interface: {{ network['ipv4_interface'] }}
+ ipv4_ovh_failover: {{ salt['node.has']('network:ipv4_ovh_failover') }}
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 14:05 (7 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260306
Default Alt Text
D2331.id.diff (1 KB)

Event Timeline