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 %} }; };