Page MenuHomeDevCentral

D3384.id8735.diff
No OneTemporary

D3384.id8735.diff

diff --git a/roles/core/network/init.sls b/roles/core/network/init.sls
--- a/roles/core/network/init.sls
+++ b/roles/core/network/init.sls
@@ -9,6 +9,8 @@
include:
- .ipv4
- .ipv6
+ - .ipv6_tunnel
+ - .ipv6_fixes
- .dhclient6
- .gre
- .routes
diff --git a/roles/core/network/ipv6.sls b/roles/core/network/ipv6.sls
--- a/roles/core/network/ipv6.sls
+++ b/roles/core/network/ipv6.sls
@@ -2,21 +2,10 @@
# Salt — Network
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2016-06-15
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-# -------------------------------------------------------------
-# Table of contents
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-#
-# :: Native IPv6
-# :: 4to6 tunnel
-# :: Routes
-#
-# -------------------------------------------------------------
-
-{% from "map.jinja" import dirs, services with context %}
+{% from "map.jinja" import dirs with context %}
{% set network = salt['node.get']('network') %}
@@ -60,67 +49,3 @@
{% endif %}
{% endif %}
{% endfor %}
-
-# -------------------------------------------------------------
-# 4to6 tunnel
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-{% if salt['node.has']('network:ipv6_tunnel') %}
-network_ipv6:
- file.managed:
- - name : {{ dirs.sbin }}/ipv6-setup-tunnel
- - source: salt://roles/core/network/files/ipv6-tunnels/{{ grains['id'] }}.sh.jinja
- - template: jinja
- - mode: 755
-
-{% if services['manager'] == 'systemd' %}
-/etc/systemd/system/ipv6-tunnel.service:
- file.managed:
- - source: salt://roles/core/network/files/ipv6-tunnels/ipv6-tunnel.service
- - mode: 755
- service.running:
- - name: ipv6-tunnel
- - enable: true
-{% endif %}
-
-
-{% endif %}
-
-# -------------------------------------------------------------
-# Routes - legacy configuration for ipv6_gateway
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-{% if "ipv6_gateway" in network %}
-
-{% if grains['os'] == 'FreeBSD' %}
-/etc/rc.conf.d/routing/ipv6:
- file.managed:
- - source: salt://roles/core/network/files/FreeBSD/routing_ipv6.rc
- - makedirs: True
- - template: jinja
- - context:
- ipv6_gateway: {{ network["ipv6_gateway"] }}
-{% endif %}
-
-{% endif %}
-
-# -------------------------------------------------------------
-# Routes - IPv6 fix for OVH
-#
-# OVH network doesn't announce an IPv6 route for a VM at first.
-# If from the VM, we reach another network, the route is then
-# announced for a while, before being dropped.
-#
-# To workaround that behavior, solution is to ping regularly
-# an external site so packets reach OVH router and a route is
-# announced.
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-{% if salt['node.has']('fixes:hello_ipv6_ovh') %}
-
-/usr/local/etc/cron.d/hello-ipv6:
- file.managed:
- - source: salt://roles/core/network/files/FreeBSD/hello-ipv6.cron
- - makedirs: True
-
-{% endif %}
diff --git a/roles/core/network/ipv6_fixes.sls b/roles/core/network/ipv6_fixes.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/network/ipv6_fixes.sls
@@ -0,0 +1,47 @@
+# -------------------------------------------------------------
+# Salt — Network
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set network = salt['node.get']('network') %}
+
+# -------------------------------------------------------------
+# Routes - legacy configuration for ipv6_gateway
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if "ipv6_gateway" in network %}
+
+{% if grains['os'] == 'FreeBSD' %}
+/etc/rc.conf.d/routing/ipv6:
+ file.managed:
+ - source: salt://roles/core/network/files/FreeBSD/routing_ipv6.rc
+ - makedirs: True
+ - template: jinja
+ - context:
+ ipv6_gateway: {{ network["ipv6_gateway"] }}
+{% endif %}
+
+{% endif %}
+
+# -------------------------------------------------------------
+# Routes - IPv6 fix for OVH
+#
+# OVH network doesn't announce an IPv6 route for a VM at first.
+# If from the VM, we reach another network, the route is then
+# announced for a while, before being dropped.
+#
+# To workaround that behavior, solution is to ping regularly
+# an external site so packets reach OVH router and a route is
+# announced.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if salt['node.has']('fixes:hello_ipv6_ovh') %}
+
+/usr/local/etc/cron.d/hello-ipv6:
+ file.managed:
+ - source: salt://roles/core/network/files/FreeBSD/hello-ipv6.cron
+ - makedirs: True
+
+{% endif %}
diff --git a/roles/core/network/ipv6_tunnel.sls b/roles/core/network/ipv6_tunnel.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/network/ipv6_tunnel.sls
@@ -0,0 +1,34 @@
+# -------------------------------------------------------------
+# Salt — Network
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs, services with context %}
+
+# -------------------------------------------------------------
+# 4to6 tunnel
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if salt['node.has']('network:ipv6_tunnel') %}
+
+network_ipv6:
+ file.managed:
+ - name : {{ dirs.sbin }}/ipv6-setup-tunnel
+ - source: salt://roles/core/network/files/ipv6-tunnels/{{ grains['id'] }}.sh.jinja
+ - template: jinja
+ - mode: 755
+
+{% if services['manager'] == 'systemd' %}
+/etc/systemd/system/ipv6-tunnel.service:
+ file.managed:
+ - source: salt://roles/core/network/files/ipv6-tunnels/ipv6-tunnel.service
+ - mode: 755
+ service.running:
+ - name: ipv6-tunnel
+ - enable: true
+{% endif %}
+
+
+{% endif %}

File Metadata

Mime Type
text/plain
Expires
Fri, Sep 20, 22:40 (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2155328
Default Alt Text
D3384.id8735.diff (6 KB)

Event Timeline