Commit a35a5302 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

Merge branch 'fix-hcloud-vm-migrations' into 'master'

improve terraform handling of virtual machine domains

See merge request !280
parents d23d14ca 38dc2292
Pipeline #4813 passed with stage
in 44 seconds
......@@ -36,7 +36,7 @@ locals {
#
# Valid parameters are:
# - server_type (mandatory)
# - domain (mandatory)
# - domain (optional, creates dns entry <domain>.archlinux.org pointing to the machine)
# - ttl (optional, applies to the dns entries)
# - zone (optionel, required for pkgbuild.com machines)
#
......@@ -81,7 +81,6 @@ locals {
}
"lists.archlinux.org" = {
server_type = "cx11"
domain = "lists"
}
"mail.archlinux.org" = {
server_type = "cx11"
......
......@@ -116,7 +116,9 @@ resource "hcloud_server" "machine" {
}
resource "hetznerdns_record" "machine_a" {
for_each = local.machines
for_each = {
for name, machine in local.machines : name => machine if can(machine.domain)
}
zone_id = lookup(local.machines[each.key], "zone", hetznerdns_zone.archlinux.id)
name = each.value.domain
......@@ -126,7 +128,9 @@ resource "hetznerdns_record" "machine_a" {
}
resource "hetznerdns_record" "machine_aaaa" {
for_each = local.machines
for_each = {
for name, machine in local.machines : name => machine if can(machine.domain)
}
zone_id = lookup(local.machines[each.key], "zone", hetznerdns_zone.archlinux.id)
name = each.value.domain
......
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