From 7c9f135da554f85ff1aca93e30e4cc13e5cdbfbc Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 8 Nov 2020 20:34:21 +0000 Subject: [PATCH] dns/master: Add support for slaves as IPs (slaves_ip) --- roles/dns/master/defaults/main.yml | 1 + roles/dns/master/templates/zone.conf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/roles/dns/master/defaults/main.yml b/roles/dns/master/defaults/main.yml index 745b249..f992033 100644 --- a/roles/dns/master/defaults/main.yml +++ b/roles/dns/master/defaults/main.yml @@ -23,5 +23,6 @@ expire: 3600000 ttl: "{{ global_dns_ttl }}" slaves: [] # for retriving IPs automatically by Ansible +slaves_ip: [] dname_subdomain: "external" # Must not contain the base domain, can be used to allow ignoring local overrides on purpose, will be ignored if empty diff --git a/roles/dns/master/templates/zone.conf b/roles/dns/master/templates/zone.conf index 01c55bf..502e09d 100644 --- a/roles/dns/master/templates/zone.conf +++ b/roles/dns/master/templates/zone.conf @@ -36,11 +36,17 @@ zone "{{ domain }}" { {{ hostvars[fqdn].ansible_default_ipv4.address }}; {{ hostvars[fqdn].ansible_default_ipv6.address }}; {% endfor %} + {% for ip in slaves_ip %} + {{ ip }}; + {% endfor %} }; also-notify { {% for fqdn in slaves %} {{ hostvars[fqdn].ansible_default_ipv4.address }}; {{ hostvars[fqdn].ansible_default_ipv6.address }}; {% endfor %} + {% for ip in slaves_ip %} + {{ ip }}; + {% endfor %} }; };