2020-12-27 03:57:32 +01:00
|
|
|
# This files contains template handling for the main archlinux.tf file
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "archlinux_org_gitlab_pages_cname" {
|
2020-12-27 22:16:32 +01:00
|
|
|
for_each = local.archlinux_org_gitlab_pages
|
2020-12-27 03:57:32 +01:00
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
2020-12-27 22:16:32 +01:00
|
|
|
name = each.key
|
2020-12-27 03:57:32 +01:00
|
|
|
value = "pages.archlinux.org."
|
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "archlinux_org_gitlab_pages_verification_code_txt" {
|
2020-12-27 22:16:32 +01:00
|
|
|
for_each = local.archlinux_org_gitlab_pages
|
2020-12-27 03:57:32 +01:00
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
2020-12-28 02:14:12 +01:00
|
|
|
name = "_gitlab-pages-verification-code.${each.key}"
|
2020-12-27 22:16:32 +01:00
|
|
|
value = "gitlab-pages-verification-code=${each.value}"
|
2020-12-27 03:57:32 +01:00
|
|
|
type = "TXT"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "pkgbuild_org_a" {
|
|
|
|
for_each = local.pkgbuild_com_a_aaaa
|
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.pkgbuild.id
|
|
|
|
name = each.key
|
|
|
|
ttl = lookup(local.pkgbuild_com_a_aaaa[each.key], "ttl", null)
|
|
|
|
value = each.value.ipv4_address
|
|
|
|
type = "A"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "pkgbuild_org_aaaa" {
|
|
|
|
for_each = local.pkgbuild_com_a_aaaa
|
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.pkgbuild.id
|
|
|
|
name = each.key
|
|
|
|
ttl = lookup(local.pkgbuild_com_a_aaaa[each.key], "ttl", null)
|
|
|
|
value = each.value.ipv6_address
|
|
|
|
type = "AAAA"
|
|
|
|
}
|
|
|
|
|
2020-12-27 23:13:29 +01:00
|
|
|
resource "hetznerdns_record" "archlinux_org_txt" {
|
|
|
|
for_each = local.archlinux_org_txt
|
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
|
|
|
name = each.key
|
|
|
|
ttl = lookup(local.archlinux_org_txt[each.key], "ttl", null)
|
2020-12-31 02:26:40 +01:00
|
|
|
value = "\"${each.value.value}\" "
|
2020-12-27 23:13:29 +01:00
|
|
|
type = "TXT"
|
|
|
|
}
|
|
|
|
|
2020-12-28 00:09:26 +01:00
|
|
|
resource "hetznerdns_record" "archlinux_org_mx" {
|
2020-12-28 19:21:55 +01:00
|
|
|
for_each = local.archlinux_org_mx
|
2020-12-28 00:09:26 +01:00
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
|
|
|
name = each.key
|
2020-12-28 19:21:55 +01:00
|
|
|
ttl = lookup(local.archlinux_org_mx[each.key], "ttl", null)
|
2020-12-28 00:09:26 +01:00
|
|
|
value = "10 ${each.value.mx}"
|
|
|
|
type = "MX"
|
|
|
|
}
|
|
|
|
|
2020-12-27 03:57:32 +01:00
|
|
|
resource "hetznerdns_record" "archlinux_org_a" {
|
|
|
|
for_each = local.archlinux_org_a_aaaa
|
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
|
|
|
name = each.key
|
|
|
|
ttl = lookup(local.archlinux_org_a_aaaa[each.key], "ttl", null)
|
|
|
|
value = each.value.ipv4_address
|
|
|
|
type = "A"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "archlinux_org_aaaa" {
|
|
|
|
for_each = local.archlinux_org_a_aaaa
|
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
|
|
|
name = each.key
|
|
|
|
ttl = lookup(local.archlinux_org_a_aaaa[each.key], "ttl", null)
|
|
|
|
value = each.value.ipv6_address
|
|
|
|
type = "AAAA"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "archlinux_org_cname" {
|
2020-12-27 22:11:59 +01:00
|
|
|
for_each = local.archlinux_org_cname
|
2020-12-27 03:57:32 +01:00
|
|
|
|
|
|
|
zone_id = hetznerdns_zone.archlinux.id
|
|
|
|
name = each.key
|
2020-12-27 22:11:59 +01:00
|
|
|
ttl = lookup(local.archlinux_org_cname[each.key], "ttl", null)
|
2020-12-27 03:57:32 +01:00
|
|
|
value = each.value.value
|
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hcloud_rdns" "rdns_ipv4" {
|
|
|
|
for_each = local.machines
|
|
|
|
|
|
|
|
server_id = hcloud_server.machine[each.key].id
|
|
|
|
ip_address = hcloud_server.machine[each.key].ipv4_address
|
|
|
|
dns_ptr = each.key
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hcloud_rdns" "rdns_ipv6" {
|
|
|
|
for_each = local.machines
|
|
|
|
|
|
|
|
server_id = hcloud_server.machine[each.key].id
|
|
|
|
ip_address = hcloud_server.machine[each.key].ipv6_address
|
|
|
|
dns_ptr = each.key
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hcloud_server" "machine" {
|
|
|
|
for_each = local.machines
|
|
|
|
|
2022-04-23 02:13:59 +02:00
|
|
|
name = each.key
|
|
|
|
image = data.hcloud_image.archlinux.id
|
|
|
|
server_type = each.value.server_type
|
|
|
|
keep_disk = true
|
|
|
|
location = "fsn1"
|
|
|
|
delete_protection = true
|
|
|
|
rebuild_protection = true
|
2020-12-27 03:57:32 +01:00
|
|
|
lifecycle {
|
2021-11-03 19:42:09 +01:00
|
|
|
ignore_changes = [image, location]
|
2020-12-27 03:57:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "machine_a" {
|
2021-01-24 16:18:19 +01:00
|
|
|
for_each = {
|
|
|
|
for name, machine in local.machines : name => machine if can(machine.domain)
|
|
|
|
}
|
2020-12-27 03:57:32 +01:00
|
|
|
|
|
|
|
zone_id = lookup(local.machines[each.key], "zone", hetznerdns_zone.archlinux.id)
|
|
|
|
name = each.value.domain
|
|
|
|
ttl = lookup(local.machines[each.key], "ttl", null)
|
|
|
|
value = hcloud_server.machine[each.key].ipv4_address
|
|
|
|
type = "A"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "hetznerdns_record" "machine_aaaa" {
|
2021-01-24 16:18:19 +01:00
|
|
|
for_each = {
|
|
|
|
for name, machine in local.machines : name => machine if can(machine.domain)
|
|
|
|
}
|
2020-12-27 03:57:32 +01:00
|
|
|
|
|
|
|
zone_id = lookup(local.machines[each.key], "zone", hetznerdns_zone.archlinux.id)
|
|
|
|
name = each.value.domain
|
|
|
|
ttl = lookup(local.machines[each.key], "ttl", null)
|
|
|
|
value = hcloud_server.machine[each.key].ipv6_address
|
|
|
|
type = "AAAA"
|
|
|
|
}
|
2022-05-13 21:49:16 +02:00
|
|
|
|
|
|
|
resource "hetznerdns_record" "geo_ns1" {
|
|
|
|
for_each = local.geo_domains
|
|
|
|
|
|
|
|
zone_id = each.value.zone_id
|
|
|
|
name = each.value.name
|
|
|
|
value = "asia.mirror.pkgbuild.com."
|
|
|
|
type = "NS"
|
|
|
|
ttl = 86400
|
|
|
|
}
|
|
|
|
|
2022-05-13 22:13:26 +02:00
|
|
|
resource "hetznerdns_record" "geo_ns2" {
|
2022-05-13 21:49:16 +02:00
|
|
|
for_each = local.geo_domains
|
|
|
|
|
|
|
|
zone_id = each.value.zone_id
|
|
|
|
name = each.value.name
|
|
|
|
value = "america.mirror.pkgbuild.com."
|
|
|
|
type = "NS"
|
|
|
|
ttl = 86400
|
|
|
|
}
|
|
|
|
|
2022-05-13 22:13:26 +02:00
|
|
|
resource "hetznerdns_record" "geo_ns3" {
|
2022-05-13 21:49:16 +02:00
|
|
|
for_each = local.geo_domains
|
|
|
|
|
|
|
|
zone_id = each.value.zone_id
|
|
|
|
name = each.value.name
|
|
|
|
value = "europe.mirror.pkgbuild.com."
|
|
|
|
type = "NS"
|
|
|
|
ttl = 86400
|
|
|
|
}
|