dataset/seed/dns-local/templates/dns-local.yml

26 lines
979 B
YAML
Raw Permalink Normal View History

2023-06-23 08:12:05 +02:00
address: '{{ domain_name_eth0 }}'
addresses:
2023-06-23 08:12:05 +02:00
{% if 'dns_client_address' in general.network %}
- dns_address: '{{ general.network.dns_client_address }}'
dns_ip: '{{ ip_dns }}'
2023-07-31 15:30:32 +02:00
{% elif 'dns_resolver' in general and 'unbound_forward_address' in general.dns_resolver.forward_zones.unbound_forward_address %}
2023-06-23 08:12:05 +02:00
{% for authority in general.dns_resolver.forward_zones.unbound_forward_address %}
- dns_address: {{ authority }}
dns_ip: {{ authority.unbound_allowed_client }}
{% endfor %}
2023-07-31 15:30:32 +02:00
{% elif 'dns_zone' in general and 'nsd_zones' in general.dns_zone %}
{% for zone in general.dns_zone.nsd_zones %}
2023-06-23 08:12:05 +02:00
{% set suffix = zone|normalize_family %}
{% set hostnames = nsd["nsd_zone_" + suffix]["hostname_" + suffix]["hostname_" + suffix] %}
{% for hostname in hostnames %}
- dns_address: {{ hostname }}.{{ zone }}
dns_ip: {{ hostname["ip_" + suffix] }}
{% endfor %}
{% endfor %}
{% endif %}
{% if dns_is_only_local %}
dns_is_only_local: true
2023-06-23 08:12:05 +02:00
{% else %}
dns_is_only_local: false
2023-06-23 08:12:05 +02:00
{% endif %}