Browse Source

Icinga2: Read NS replica information from DNS pillar

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 1 year ago
parent
commit
3594940a1d
1 changed files with 6 additions and 3 deletions
  1. 6 3
      icinga2/services/dns.conf

+ 6 - 3
icinga2/services/dns.conf

@@ -66,15 +66,16 @@ apply Service "dns_sync" {
 
 
 ################################################################################
-#                            External DNS services                             #
+#                            External DNS replicas                             #
 ################################################################################
 
-apply Service "dns_sync_dns01.srv.rfc2324.org" {
+{%- for replica, IPs in salt['pillar.get']('dns-server:acls:replicas', {}).items()|sort %}
+apply Service "dns_sync_{{ replica }}" {
 	import "generic-service"
 
 	check_command = "dns_sync"
 	vars.reference_ns = "{{ reference_ns }}"
-	vars.replica_ns = "31.172.8.66"
+	vars.replica_ns = "{{ IPs[0] }}"
 	vars.zones = [
 		"ffho.net",
 		"hochstift.freifunk.net",
@@ -83,3 +84,5 @@ apply Service "dns_sync_dns01.srv.rfc2324.org" {
 
 	assign where "dns-server-master" in host.vars.roles
 }
+
+{%- endfor %}