1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/geo_dns/templates/geo.yml.j2
Evangelos Foutras 19ee76d74c
geo_dns: support geo domains with subset of hosts
Useful if we wanted to create a Geo-based archive consisting of machines
in the archive_mirrors group (though this will likely not happen because
it'd break archlinux-repro due to the ~4 hour sync delay).
2022-08-21 04:44:46 +03:00

30 lines
1.3 KiB
Django/Jinja

#jinja2:lstrip_blocks: True
domains:
{% for domain in geo_domains %}
{% set hosts = geo_options[domain]['hosts'] | default(groups['geo_mirrors']) %}
- domain: {{ domain }}
ttl: 3600
records:
{{ domain }}:
- soa: {{ groups['geo_mirrors'] | first }}. root.archlinux.org. 2022042701 3600 1800 604800 3600
{% for host in groups['geo_mirrors'] %}
- ns:
ttl: {{ geo_options[domain]['ns_ttl'] | default(86400) }}
content: {{ host }}
{% endfor %}
- lua:
ttl: 300
content: >
A "ifurlup('https://{{ domain }}{{ geo_options[domain]['health_check_path'] | default('/') }}',
{'{{ hosts | map('extract', hostvars, ['ipv4_address']) | join("', '") }}'},
{selector='pickclosest', useragent='pdns on {{ inventory_hostname }}'})"
- lua:
ttl: 300
content: >
AAAA "ifurlup('https://{{ domain }}{{ geo_options[domain]['health_check_path'] | default('/') }}',
{'{{ hosts | map('extract', hostvars, ['ipv6_address']) | join("', '") }}'},
{selector='pickclosest', useragent='pdns on {{ inventory_hostname }}'})"
_acme-challenge.{{ domain }}:
- ns: {{ geo_acme_dns_challenge_ns }}
{% endfor %}