diff --git a/main.tf b/main.tf index f285ec7..82908b3 100644 --- a/main.tf +++ b/main.tf @@ -134,8 +134,6 @@ provider "postgresql" { module "services" { source = "./modules/services" - depends_on = [ module.infrastructure ] - authentik_url = var.authentik_url services = var.services diff --git a/modules/infrastructure/hcloud.tf b/modules/infrastructure/hcloud.tf index 604f473..adcbb88 100644 --- a/modules/infrastructure/hcloud.tf +++ b/modules/infrastructure/hcloud.tf @@ -12,6 +12,11 @@ data "template_file" "cloud_init" { } } +resource "hcloud_placement_group" "default" { + name = "serguzim.net" + type = "spread" +} + resource "hcloud_primary_ip" "node_ipv4_addresses" { for_each = local.hetzner_hosts name = "primary_ipv4_${each.value.hostname}" @@ -39,6 +44,7 @@ resource "hcloud_server" "nodes" { server_type = each.value.server_type ssh_keys = [hcloud_ssh_key.default.id] user_data = data.template_file.cloud_init.rendered + placement_group_id = hcloud_placement_group.default.id public_net { ipv4 = hcloud_primary_ip.node_ipv4_addresses[each.key].id ipv6 = hcloud_primary_ip.node_ipv6_addresses[each.key].id