Verified Commit 79449811 authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

tf-stage1: use template for geo domains NS records

parent d8958415
......@@ -364,6 +364,14 @@ locals {
ipv6_address = hcloud_server.machine["homedir.archlinux.org"].ipv6_address
}
}
# Domains served by machines in the geo_mirrors group
geo_domains = {
"geo.mirror.pkgbuild.com" = {
zone_id = hetznerdns_zone.pkgbuild.id
name = "geo.mirror"
}
}
}
resource "hetznerdns_zone" "archlinux" {
......@@ -431,38 +439,6 @@ resource "hetznerdns_record" "pkgbuild_com_origin_txt" {
type = "TXT"
}
resource "hetznerdns_record" "pkgbuild_com_geo_mirror_ns1" {
zone_id = hetznerdns_zone.pkgbuild.id
name = "geo.mirror"
value = "mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "pkgbuild_com_geo_mirror_ns2" {
zone_id = hetznerdns_zone.pkgbuild.id
name = "geo.mirror"
value = "asia.mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "pkgbuild_com_geo_mirror_ns3" {
zone_id = hetznerdns_zone.pkgbuild.id
name = "geo.mirror"
value = "america.mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "pkgbuild_com_geo_mirror_ns4" {
zone_id = hetznerdns_zone.pkgbuild.id
name = "geo.mirror"
value = "europe.mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "archlinux_org_origin_caa" {
zone_id = hetznerdns_zone.archlinux.id
name = "@"
......
......@@ -142,3 +142,43 @@ resource "hetznerdns_record" "machine_aaaa" {
value = hcloud_server.machine[each.key].ipv6_address
type = "AAAA"
}
resource "hetznerdns_record" "geo_ns1" {
for_each = local.geo_domains
zone_id = each.value.zone_id
name = each.value.name
value = "mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "geo_ns2" {
for_each = local.geo_domains
zone_id = each.value.zone_id
name = each.value.name
value = "asia.mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "geo_ns3" {
for_each = local.geo_domains
zone_id = each.value.zone_id
name = each.value.name
value = "america.mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
resource "hetznerdns_record" "geo_ns4" {
for_each = local.geo_domains
zone_id = each.value.zone_id
name = each.value.name
value = "europe.mirror.pkgbuild.com."
type = "NS"
ttl = 86400
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment