db.services.tld-template.j2 1004 B

123456789101112131415161718192021222324
  1. ; zonefile for services.{{item.key}}.
  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. {% set i = [1] %}
  10. {% for host in groups['gateways'] %}
  11. {% if 'is_external_nameserver' in hostvars[host] and hostvars[host].is_external_nameserver %}
  12. @ IN NS ns{{i[0]}}.{{item.key}}.
  13. {% if i.append(i.pop() + 1) %}{% endif %}
  14. {% endif %}
  15. {% endfor %}
  16. {% if bind.ffms_for_groups is defined and bind.ffms_for_groups.0 is defined %}
  17. {% for group in bind.ffms_for_groups %}
  18. {% if "static_hosts" in hostvars[groups[group][0]] %}
  19. {% for host in hostvars[groups[group][0]].static_hosts %}
  20. {{host.name}} IN A {{host.v4_address}}
  21. {% endfor %}
  22. {% endif %}
  23. {% endfor %}
  24. {% endif %}