Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12239246
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/roles/core/network/init.sls b/roles/core/network/init.sls
index 1667c84..1c1f11b 100644
--- a/roles/core/network/init.sls
+++ b/roles/core/network/init.sls
@@ -1,21 +1,23 @@
# -------------------------------------------------------------
# Salt — Network
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2020-09-20
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- .ipv4
- .ipv6
+ - .ipv6_tunnel
+ - .ipv6_fixes
- .dhclient6
- .gre
- .routes
# Drake can be configured as:
#
# - ipv4 (e.g. IntraNought network cards on EXSi hypervisor VMs)
# - gre (e.g. isolated servers needing a tunnel)
#
# Both are needed for servers with router role.
diff --git a/roles/core/network/ipv6.sls b/roles/core/network/ipv6.sls
index e8e25b6..ee2d580 100644
--- a/roles/core/network/ipv6.sls
+++ b/roles/core/network/ipv6.sls
@@ -1,126 +1,51 @@
# -------------------------------------------------------------
# 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') %}
# -------------------------------------------------------------
# Native IPv6
#
# Flags:
#
# - On Online, we need to send a request to a DHCP server
# with the assigned DUID.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% for interface_name, interface in network["interfaces"].items() %}
{% if "ipv6" in interface %}
{% if grains['os'] == 'FreeBSD' %}
/etc/rc.conf.d/netif/ipv6_{{ interface['device'] }}:
file.managed:
- source: salt://roles/core/network/files/FreeBSD/netif_ipv6.rc
- makedirs: True
- template: jinja
- context:
interface: {{ interface['device'] }}
ipv6_address: {{ interface['ipv6']['address'] }}
ipv6_prefix: {{ interface['ipv6']['prefix'] | default(64) }}
has_native_ipv6: True
{% if "gateway" in interface["ipv6"] %}
/etc/rc.conf.d/routing/ipv6:
file.managed:
- source: salt://roles/core/network/files/FreeBSD/routing_ipv6.rc
- makedirs: True
- template: jinja
- context:
interface: {{ interface['device'] }}
ipv6_address: {{ interface['ipv6']['address'] }}
ipv6_prefix: {{ interface['ipv6']['prefix'] | default(64) }}
ipv6_gateway: {{ interface['ipv6']['gateway'] }}
{% endif %}
{% 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
index 0000000..5889499
--- /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
index 0000000..64451d2
--- /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
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Oct 11, 21:01 (5 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3064009
Default Alt Text
(8 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment