aboutsummaryrefslogtreecommitdiffstats
path: root/roles/dns/templates/zones/233233.xyz.zone.j2
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-09-21 17:48:52 +0800
committerAaron LI <aly@aaronly.me>2019-09-21 17:48:52 +0800
commit46cfbbc64f1aa1af1892401436c6d85f7d8ca810 (patch)
tree118936102534426ef15d318d3f48d979aa09c917 /roles/dns/templates/zones/233233.xyz.zone.j2
parent83d991daa85a00ade2ee455aeef2c21e9aceb07d (diff)
downloadansible-dfly-vps-46cfbbc64f1aa1af1892401436c6d85f7d8ca810.tar.bz2
zones/233233.xyz: Do not hardcode subdomains
Diffstat (limited to 'roles/dns/templates/zones/233233.xyz.zone.j2')
-rw-r--r--roles/dns/templates/zones/233233.xyz.zone.j212
1 files changed, 11 insertions, 1 deletions
diff --git a/roles/dns/templates/zones/233233.xyz.zone.j2 b/roles/dns/templates/zones/233233.xyz.zone.j2
index efe0716..9f41554 100644
--- a/roles/dns/templates/zones/233233.xyz.zone.j2
+++ b/roles/dns/templates/zones/233233.xyz.zone.j2
@@ -21,8 +21,18 @@ $TTL {{ dns.ttl }}
@ IN A {{ network.ipv4.address }}
@ IN AAAA {{ network.ipv6.address }}
-{% for name in ["www", "d", "g", "zw", "*"] %}
+{% set subdomains = [] %}
+{% for name in domains -%}
+ {%- if name["name"] == domain -%}
+ {%- for sub in name["sub"] -%}
+ {{ subdomains.append(sub) }}
+ {%- endfor -%}
+ {%- endif -%}
+{%- endfor %}
+{% for name in subdomains %}
{{ name }} IN CNAME @
{% endfor %}
+* IN CNAME @
+
; vim: set ft=bindzone: