Browse Source

network: Add support for ifupdown-ng.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 3 years ago
parent
commit
a680b2fa18
3 changed files with 54 additions and 0 deletions
  1. 25 0
      network/ifupdown-ng/ifupdown-ng.conf
  2. 19 0
      network/ifupdown-ng/init.sls
  3. 10 0
      network/ifupdown-ng/reload.sls

+ 25 - 0
network/ifupdown-ng/ifupdown-ng.conf

@@ -0,0 +1,25 @@
+#
+# /etc/network/ifupdown-ng.conf (Salt managed)
+#
+# The settings specified here are the defaults of ifupdown-ng.
+
+# allow_addon_scripts:
+# Enable support for /etc/if-X.d addon scripts.  These are used for
+# compatibility with legacy setups, and may be disabled for performance
+# improvements in setups where only ifupdown-ng executors are used.
+allow_addon_scripts = 0
+
+# allow_any_iface_as_template:
+# Enable any interface to act as a template for another interface.
+# This is presently the default, but is deprecated.  An admin may choose
+# to disable this setting in order to require inheritance from specified
+# templates.
+allow_any_iface_as_template = 0
+
+# implicit_template_conversion:
+# In some legacy configs, a template may be declared as an iface, and
+# ifupdown-ng automatically converts those declarations to a proper
+# template.  If this setting is disabled, inheritance will continue to
+# work against non-template interfaces without converting them to a
+# template.
+implicit_template_conversion = 1

+ 19 - 0
network/ifupdown-ng/init.sls

@@ -0,0 +1,19 @@
+#
+# Use ifupdown-ng to manage the interfaces of this box
+#
+
+ifupdown-ng:
+  pkg.installed
+
+# ifupdown-ng configuration
+/etc/network/ifupdown-ng.conf:
+  file.managed:
+    - source:
+      - salt://network/ifupdown-ng/ifupdown-ng.conf
+
+# Remove workaround for ifupdown2
+remove-ifupdown2-workarounds:
+  file.absent:
+    - name:
+      - /usr/local/sbin/ff_fix_default_route
+      - /etc/cron.d/ff_fix_default_route

+ 10 - 0
network/ifupdown-ng/reload.sls

@@ -0,0 +1,10 @@
+#
+# network.ifupdown-ng.reload
+#
+
+# Reload interface configuration if neccessary (no-op for now)
+ifreload:
+  cmd.wait:
+    - name: /bin/true
+    - watch:
+      - file: /etc/network/interfaces