Browse Source

Make DNS resolvers and search domain configurable.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 5 years ago
parent
commit
3e6b67c87a
4 changed files with 12 additions and 3 deletions
  1. 1 1
      bird/radv.conf
  2. 1 0
      network/init.sls
  3. 3 2
      network/resolv.conf
  4. 7 0
      zz_EXAMPLE_PILLAR/globals.sls

+ 1 - 1
bird/radv.conf

@@ -6,7 +6,7 @@ protocol radv {
 	export all;
 	trigger ::/0;
 
-	rdnss 2a03:2260:2342:f251::53;
+	rdnss {{ salt['pillar.get'] ('globals:dns:resolver_v6') }};
 
 {%- if grains.id.startswith('gw') %}
 {% for site in node_config.get ('sites', []) %}

+ 1 - 0
network/init.sls

@@ -64,3 +64,4 @@ vnstat:
 /etc/resolv.conf:
   file.managed:
     - source: salt://network/resolv.conf
+    - template: jinja

+ 3 - 2
network/resolv.conf

@@ -1,5 +1,6 @@
 #
 # /etc/resolv.conf (Salt managed)
 #
-search in.ffho.net
-nameserver 10.132.251.53
+search {{ salt['pillar.get'] ('globals:dns:search') }}
+nameserver {{ salt['pillar.get'] ('globals:dns:resolver_v4') }}
+nameserver {{ salt['pillar.get'] ('globals:dns:resolver_v6') }}

+ 7 - 0
zz_EXAMPLE_PILLAR/globals.sls

@@ -10,4 +10,11 @@ globals:
     # read-only community string for snmpd
     ro_community: "not_public"
 
+  # DNS settings
+  dns:
+    # IP address of DNS resolver for nodes (should be anycasted)
+    resolver_v4: 10.132.251.53
+    resolver_v6: 2a03:2260:2342:f251::53
 
+    # Search domain
+    search: in.ffho.net