db.servers.ffnet.j2 1.4 KB

123456789101112131415161718192021222324252627
  1. ; zonefile for servers.{{freifunk.kurzname}}.
  2. $TTL 86400
  3. @ IN SOA {{bind_zonemaster.server}}. {{bind_zonemaster.email}}. (
  4. {{ansible_date_time.epoch}} ; Serial
  5. 604800 ; Refresh
  6. 86400 ; Retry
  7. 2419200 ; Expire
  8. 86400 ) ; Negative Cache TTL
  9. ;
  10. @ IN NS {{bind.ns_name}}.servers.{{freifunk.kurzname}}.
  11. {{bind.ns_name}} IN A {{ansible_default_ipv4.address}}
  12. {% if bind.ffms_for_groups is defined and bind.ffms_for_groups.0 is defined %}
  13. {% for group in bind.ffms_for_groups %}
  14. {% for host in groups[group] %}
  15. {{host}} IN A {{hostvars[host].ff_network.v4_network | ipaddr(hostvars[host].server_id) | ipaddr('address') }};
  16. {{host}} IN AAAA {{hostvars[host].ff_network.v6_network | ipaddr(hostvars[host].server_id) | ipaddr('address') }};
  17. {% endfor %}
  18. {% endfor %}
  19. {% endif %}
  20. {% for host in groups['gateways'] %}
  21. {% if hostvars[host].domaenenliste is defined %}
  22. {% for domaene in hostvars[host].domaenenliste|dictsort %}
  23. {{host}} IN A {{domaenen[domaene[0]].ffv4_network | ipaddr(domaene[1].server_id) | ipaddr('address') }};
  24. {{host}} IN AAAA {{domaenen[domaene[0]].ffv6_network | ipaddr(domaene[1].server_id) | ipaddr('address') }};
  25. {% endfor %}
  26. {% endif %}
  27. {% endfor %}