Page MenuHomeDevCentral

D2309.id5818.diff
No OneTemporary

D2309.id5818.diff

diff --git a/roles/core/network/files/Debian/10-gre.jinja b/roles/core/network/files/Debian/10-gre.jinja
new file mode 100644
--- /dev/null
+++ b/roles/core/network/files/Debian/10-gre.jinja
@@ -0,0 +1,21 @@
+# -------------------------------------------------------------
+# Network — interfaces configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/network/files/Debian/10-gre.jinja
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+auto {{ interface }}
+iface {{ interface }} inet static
+address {{ src }}
+netmask {{ netmask }}
+pre-up ip tunnel add {{ interface }} mode gre remote {{ icann_dst }} local {{ icann_src }} ttl 255
+up ip link set mtu 1500 dev {{ interface }}
diff --git a/roles/core/network/gre.sls b/roles/core/network/gre.sls
--- a/roles/core/network/gre.sls
+++ b/roles/core/network/gre.sls
@@ -36,6 +36,23 @@
icann_dst: {{ salt['node.get']('network', tunnel['to'])['ipv4_address'] }}
{% endif %}
+{% if grains['os_family'] == 'Debian' %}
+/etc/network/interfaces.d/10-gre-{{ description }}:
+ file.managed:
+ - source: salt://roles/core/network/files/Debian/10-gre.jinja
+ - makedirs: True
+ - template: jinja
+ - context:
+ interface: gre-{{ description }}
+
+ src: {{ tunnel_network['addr'][grains['id']] }}
+ dst: {{ tunnel_network['addr'][tunnel['to']] }}
+ netmask: {{ tunnel_network['netmask'] }}
+
+ icann_src: {{ network['ipv4_address'] }}
+ icann_dst: {{ salt['node.get']('network', tunnel['to'])['ipv4_address'] }}
+{% endif %}
+
{% endfor %}
# -------------------------------------------------------------
@@ -53,4 +70,10 @@
if_gre_load="YES"
{% endif %}
+{% if grains['os_family'] == 'Debian' %}
+ip_gre:
+ kmod.present:
+ - persist: True
+{% endif %}
+
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 08:45 (22 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2250381
Default Alt Text
D2309.id5818.diff (2 KB)

Event Timeline