瀏覽代碼

Icinga2: Read NS replica information from DNS pillar

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 1 年之前
父節點
當前提交
3594940a1d
共有 1 個文件被更改,包括 6 次插入3 次删除
  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 %}