Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3913277
D2307.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
16 KB
Referenced Files
None
Subscribers
None
D2307.diff
View Options
diff --git a/roles/core/network/files/netif_gre.rc b/roles/core/network/files/FreeBSD/netif_gre.rc
rename from roles/core/network/files/netif_gre.rc
rename to roles/core/network/files/FreeBSD/netif_gre.rc
--- a/roles/core/network/files/netif_gre.rc
+++ b/roles/core/network/files/FreeBSD/netif_gre.rc
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/netif_gre.rc
+# Source file: roles/core/network/files/FreeBSD/netif_gre.rc
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/netif.rc b/roles/core/network/files/FreeBSD/netif_ipv4.rc
rename from roles/core/network/files/netif.rc
rename to roles/core/network/files/FreeBSD/netif_ipv4.rc
--- a/roles/core/network/files/netif.rc
+++ b/roles/core/network/files/FreeBSD/netif_ipv4.rc
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/netif.rc
+# Source file: roles/core/network/files/FreeBSD/netif_ipv4.rc
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/netif_ipv6.rc b/roles/core/network/files/FreeBSD/netif_ipv6.rc
rename from roles/core/network/files/netif_ipv6.rc
rename to roles/core/network/files/FreeBSD/netif_ipv6.rc
--- a/roles/core/network/files/netif_ipv6.rc
+++ b/roles/core/network/files/FreeBSD/netif_ipv6.rc
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/netif_ipv6.rc
+# Source file: roles/core/network/files/FreeBSD/netif_ipv6.rc
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/netif_ipv6.rc b/roles/core/network/files/FreeBSD/routing_ipv4.rc
rename from roles/core/network/files/netif_ipv6.rc
rename to roles/core/network/files/FreeBSD/routing_ipv4.rc
--- a/roles/core/network/files/netif_ipv6.rc
+++ b/roles/core/network/files/FreeBSD/routing_ipv4.rc
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/netif_ipv6.rc
+# Source file: roles/core/network/files/FreeBSD/routing_ipv4.rc
# -------------------------------------------------------------
#
# <auto-generated>
@@ -13,4 +13,4 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-ifconfig_{{ interface }}_ipv6="inet6 accept_rtadv"
+defaultrouter="{{ ipv4_gateway }}"
diff --git a/roles/core/network/files/routing.rc b/roles/core/network/files/FreeBSD/routing_ipv6.rc
old mode 100644
new mode 100755
rename from roles/core/network/files/routing.rc
rename to roles/core/network/files/FreeBSD/routing_ipv6.rc
--- a/roles/core/network/files/routing.rc
+++ b/roles/core/network/files/FreeBSD/routing_ipv6.rc
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/routing.rc
+# Source file: roles/core/network/files/FreeBSD/routing_ipv6.rc
# -------------------------------------------------------------
#
# <auto-generated>
@@ -13,7 +13,4 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-defaultrouter="{{ ipv4_gateway }}"
-{%- if ipv6_gateway %}
ipv6_defaultrouter="{{ ipv6_gateway }}"
-{% endif %}
diff --git a/roles/core/network/files/dwellers_ipv6.sh.jinja b/roles/core/network/files/ipv6-tunnels/dwellers.sh.jinja
rename from roles/core/network/files/dwellers_ipv6.sh.jinja
rename to roles/core/network/files/ipv6-tunnels/dwellers.sh.jinja
--- a/roles/core/network/files/dwellers_ipv6.sh.jinja
+++ b/roles/core/network/files/ipv6-tunnels/dwellers.sh.jinja
@@ -6,7 +6,7 @@
# Project: Nasqueron
# Created: 2017-10-20
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/dwellers_ipv6.sh.jinja
+# Source file: roles/core/network/files/ipv6-tunnels/dwellers.sh.jinja
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/eglide_ipv6.sh.jinja b/roles/core/network/files/ipv6-tunnels/eglide.sh.jinja
rename from roles/core/network/files/eglide_ipv6.sh.jinja
rename to roles/core/network/files/ipv6-tunnels/eglide.sh.jinja
--- a/roles/core/network/files/eglide_ipv6.sh.jinja
+++ b/roles/core/network/files/ipv6-tunnels/eglide.sh.jinja
@@ -6,7 +6,7 @@
# Project: Eglide
# Created: 2016-06-15
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/eglide_ipv6.sh
+# Source file: roles/core/network/files/ipv6-tunnels/eglide.sh
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/equatower_ipv6.sh.jinja b/roles/core/network/files/ipv6-tunnels/equatower.sh.jinja
rename from roles/core/network/files/equatower_ipv6.sh.jinja
rename to roles/core/network/files/ipv6-tunnels/equatower.sh.jinja
--- a/roles/core/network/files/equatower_ipv6.sh.jinja
+++ b/roles/core/network/files/ipv6-tunnels/equatower.sh.jinja
@@ -6,7 +6,7 @@
# Project: Nasqueron
# Created: 2017-10-20
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/equatower_ipv6.sh.jinja
+# Source file: roles/core/network/files/ipv6-tunnels/equatower.sh.jinja
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/ysul_ipv6.sh.jinja b/roles/core/network/files/ipv6-tunnels/ysul.sh.jinja
rename from roles/core/network/files/ysul_ipv6.sh.jinja
rename to roles/core/network/files/ipv6-tunnels/ysul.sh.jinja
--- a/roles/core/network/files/ysul_ipv6.sh.jinja
+++ b/roles/core/network/files/ipv6-tunnels/ysul.sh.jinja
@@ -6,7 +6,7 @@
# Project: Nasqueron
# Created: 2017-10-20
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/ysul_ipv6.sh.jinja
+# Source file: roles/core/network/files/ipv6-tunnels/ysul.sh.jinja
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/gre.sls b/roles/core/network/gre.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/network/gre.sls
@@ -0,0 +1,56 @@
+# -------------------------------------------------------------
+# Salt — Network — GRE tunnels
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2020-09-20
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set network = salt['node.get']('network') %}
+{% set gre_tunnels = salt['pillar.get']("gre_tunnels:" + grains['id'], {}) %}
+{% set boot_loader = namespace(gre=false) %}
+
+# -------------------------------------------------------------
+# Tunnels network configuration files
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for description, tunnel in gre_tunnels.items() %}
+
+{% set boot_loader.gre = True %}
+{% set tunnel_network = pillar['networks'][tunnel['network']] %}
+
+{% if grains['os'] == 'FreeBSD' %}
+/etc/rc.conf.d/netif/gre_{{ description }}:
+ file.managed:
+ - source: salt://roles/core/network/files/FreeBSD/netif_gre.rc
+ - makedirs: True
+ - template: jinja
+ - context:
+ description: {{ description }}
+ interface: {{ tunnel['interface'] }}
+
+ src: {{ tunnel_network['addr'][grains['id']] }}
+ dst: {{ tunnel_network['addr'][tunnel['to']] }}
+
+ icann_src: {{ network['ipv4_address'] }}
+ icann_dst: {{ salt['node.get']('network', tunnel['to'])['ipv4_address'] }}
+{% endif %}
+
+{% endfor %}
+
+# -------------------------------------------------------------
+# Kernel configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if boot_loader.gre %}
+
+{% if grains['os'] == 'FreeBSD' %}
+load_gre_kernel_module:
+ file.append:
+ - name: /boot/loader.conf
+ - text: |
+
+ if_gre_load="YES"
+{% endif %}
+
+{% endif %}
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
@@ -2,108 +2,11 @@
# Salt — Network
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2016-06-15
+# Created: 2020-09-20
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% from "map.jinja" import dirs with context %}
-
-{% set network = salt['node.get']('network') %}
-
-# -------------------------------------------------------------
-# IPv4
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-{% if grains['os'] == 'FreeBSD' %}
-/etc/rc.conf.d/netif/ipv4_{{ network['ipv4_interface'] }}:
- file.managed:
- - source: salt://roles/core/network/files/netif.rc
- - makedirs: True
- - template: jinja
- - context:
- interface: {{ network['ipv4_interface'] }}
- ipv4_address: {{ network['ipv4_address'] }}
- ipv4_netmask: {{ network['ipv4_netmask'] | default('255.255.255.0') }}
- ipv4_aliases: {{ salt['node.get_list']('network:ipv4_aliases') }}
- dhcp_required: {{ salt['node.has']('network:dhcp_required') }}
- ipv6_interface: {{ network['ipv6_interface'] }}
- has_native_ipv6: {{ salt['node.has']('network:ipv6_native') }}
-
-/etc/rc.conf.d/routing:
- file.managed:
- - source: salt://roles/core/network/files/routing.rc
- - template: jinja
- - context:
- ipv4_gateway: {{ network['ipv4_gateway'] }}
- ipv6_gateway: {{ network['ipv6_gateway'] | default('') }}
-{% endif %}
-
-# -------------------------------------------------------------
-# IPv6
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-{% if salt['node.has']('network:ipv6_native') %}
-{% if grains['os'] == 'FreeBSD' %}
-/etc/rc.conf.d/netif/ipv6_{{ network['ipv6_interface'] }}:
- file.managed:
- - source: salt://roles/core/network/files/netif_ipv6.rc
- - makedirs: True
- - template: jinja
- - context:
- interface: {{ network['ipv6_interface'] }}
- ipv6_address: {{ network['ipv6_address'] }}
- ipv6_prefix: {{ network['ipv6_prefix'] | default(64) }}
- has_native_ipv6: True
-{% endif %}
-{% endif %}
-
-{% if salt['node.has']('network:ipv6_tunnel') %}
-network_ipv6:
- file.managed:
- - name : {{ dirs.sbin }}/ipv6-setup-tunnel
- - source: salt://roles/core/network/files/{{ grains['id'] }}_ipv6.sh.jinja
- - template: jinja
- - mode: 755
-{% endif %}
-
-# -------------------------------------------------------------
-# GRE tunnels
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-{% set gre_tunnels = salt['pillar.get']("gre_tunnels:" + grains['id'], {}) %}
-
-{% if grains['os'] == 'FreeBSD' %}
-
-{% set boot_loader = namespace(gre=false) %}
-
-{% for description, tunnel in gre_tunnels.items() %}
-
-{% set boot_loader.gre = True %}
-{% set tunnel_network = pillar['networks'][tunnel['network']] %}
-
-/etc/rc.conf.d/netif/gre_{{ description }}:
- file.managed:
- - source: salt://roles/core/network/files/netif_gre.rc
- - makedirs: True
- - template: jinja
- - context:
- description: {{ description }}
- interface: {{ tunnel['interface'] }}
-
- src: {{ tunnel_network['addr'][grains['id']] }}
- dst: {{ tunnel_network['addr'][tunnel['to']] }}
-
- icann_src: {{ network['ipv4_address'] }}
- icann_dst: {{ salt['node.get']('network', tunnel['to'])['ipv4_address'] }}
-{% endfor %}
-
-{% if boot_loader.gre %}
-load_gre_kernel_module:
- file.append:
- - name: /boot/loader.conf
- - text: |
-
- if_gre_load="YES"
-{% endif %}
-
-{% endif %}
+include:
+ - .ipv4
+ - .ipv6
+ - .gre
diff --git a/roles/core/network/ipv4.sls b/roles/core/network/ipv4.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/network/ipv4.sls
@@ -0,0 +1,41 @@
+# -------------------------------------------------------------
+# Salt — Network
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2016-06-15
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set network = salt['node.get']('network') %}
+
+# -------------------------------------------------------------
+# Interface
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os'] == 'FreeBSD' %}
+/etc/rc.conf.d/netif/ipv4_{{ network['ipv4_interface'] }}:
+ file.managed:
+ - source: salt://roles/core/network/files/FreeBSD/netif_ipv4.rc
+ - makedirs: True
+ - template: jinja
+ - context:
+ interface: {{ network['ipv4_interface'] }}
+ ipv4_address: {{ network['ipv4_address'] }}
+ ipv4_netmask: {{ network['ipv4_netmask'] | default('255.255.255.0') }}
+ ipv4_aliases: {{ salt['node.get_list']('network:ipv4_aliases') }}
+ dhcp_required: {{ salt['node.has']('network:dhcp_required') }}
+{% endif %}
+
+# -------------------------------------------------------------
+# Routes
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os'] == 'FreeBSD' %}
+/etc/rc.conf.d/routing/ipv4:
+ file.managed:
+ - source: salt://roles/core/network/files/FreeBSD/routing_ipv4.rc
+ - makedirs: True
+ - template: jinja
+ - context:
+ ipv4_gateway: {{ network['ipv4_gateway'] }}
+{% endif %}
diff --git a/roles/core/network/ipv6.sls b/roles/core/network/ipv6.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/network/ipv6.sls
@@ -0,0 +1,69 @@
+# -------------------------------------------------------------
+# 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 with context %}
+
+{% set network = salt['node.get']('network') %}
+
+# -------------------------------------------------------------
+# Native IPv6
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if salt['node.has']('network:ipv6_native') %}
+
+{% if grains['os'] == 'FreeBSD' %}
+/etc/rc.conf.d/netif/ipv6_{{ network['ipv6_interface'] }}:
+ file.managed:
+ - source: salt://roles/core/network/files/FreeBSD/netif_ipv6.rc
+ - makedirs: True
+ - template: jinja
+ - context:
+ interface: {{ network['ipv6_interface'] }}
+ ipv6_address: {{ network['ipv6_address'] }}
+ ipv6_prefix: {{ network['ipv6_prefix'] | default(64) }}
+ has_native_ipv6: True
+{% endif %}
+
+{% endif %}
+
+# -------------------------------------------------------------
+# 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
+{% endif %}
+
+# -------------------------------------------------------------
+# Routes
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% 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'] | default('') }}
+{% endif %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 09:13 (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2307897
Default Alt Text
D2307.diff (16 KB)
Attached To
Mode
D2307: Refactor network unit
Attached
Detach File
Event Timeline
Log In to Comment