mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-16 17:50:23 +00:00
45 lines
1.4 KiB
Django/Jinja
45 lines
1.4 KiB
Django/Jinja
;
|
|
; This file is managed/autogenerated by Salt, do not edit by hand!!
|
|
; Modify the values passed to the bind pillar instead.
|
|
;
|
|
{%- set zone_serial = soa['serial'] %}
|
|
{%- set serial_auto = zone_serial == 'auto' %}
|
|
{%- set zone_ns = soa['ns'] %}
|
|
{%- set zone_contact = soa['contact'] %}
|
|
{%- set zone_class = soa['class'] if soa['class'] is defined else 'IN' %}
|
|
{%- set zone_refresh = soa['refresh'] if soa['refresh'] is defined else '12h' %}
|
|
{%- set zone_retry = soa['retry'] if soa['retry'] is defined else '15m' %}
|
|
{%- set zone_expiry = soa['expiry'] if soa['expiry'] is defined else '2w' %}
|
|
{%- set zone_nxdomain = soa['nxdomain'] if soa['nxdomain'] is defined else '1m' %}
|
|
|
|
{% if not serial_auto or include %}
|
|
{% if soa['ttl'] is defined %}
|
|
$TTL {{ soa['ttl'] }}
|
|
{% endif %}
|
|
@ {{ zone_class }} SOA {{ zone_ns }} {{ zone_contact }} (
|
|
{{ salt['dnsutil.serial'](zone) if serial_auto else zone_serial }} ; serial
|
|
{{ zone_refresh }} ; refresh
|
|
{{ zone_retry }} ; retry
|
|
{{ zone_expiry }} ; expiry
|
|
{{ zone_nxdomain }} ; nxdomain ttl
|
|
);
|
|
{%- endif %}
|
|
|
|
{% if include %}
|
|
$INCLUDE {{ include }}
|
|
{% else %}
|
|
{% for type, rrs in records|dictsort %}
|
|
;
|
|
; {{ type }} RRs
|
|
;
|
|
{%- for host, data in rrs|dictsort %}
|
|
{%- if data is number or data is string %}
|
|
{{ host }} {{ type }} {{ data }}
|
|
{%- elif data is iterable %}
|
|
{%- for value in data %}
|
|
{{ host }} {{ type }} {{ value }}
|
|
{%- endfor %}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
{% endfor %}
|
|
{%- endif %}
|