Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jdelic committed Sep 13, 2024
1 parent 03cb4d5 commit 0b002f9
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions tf/hcloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,24 @@ locals {
ptr = null
roles = ["database", "vault", "authserver", "consulserver"]
}
/* dev = {
server_type = "cx32"
backup = 0
additional_ipv4 = 0
ipv6_only = 1
internal_only = 1
ptr = null
}
"mail.maurus.net" = {
server_type = "cpx21"
server_type = "cx22"
backup = 1
additional_ipv4 = 1
ipv6_only = 0
internal_only = 0
ptr = "mail.maurus.net"
roles = ["mail", "consulserver"]
}
/*
dev = {
server_type = "cx32"
backup = 0
additional_ipv4 = 0
ipv6_only = 1
internal_only = 1
ptr = null
roles = ["dev", "buildserver", "buildworker", "consulserver"]
}
"apps1.maurusnet.internal" = {
server_type = "cx22"
Expand Down Expand Up @@ -126,6 +129,8 @@ resource "hcloud_server" "saltmaster" {

network {
network_id = hcloud_network.internal.id
# work around https://github.com/hetznercloud/terraform-provider-hcloud/issues/650
alias_ips = []
}

public_net {
Expand Down Expand Up @@ -155,6 +160,8 @@ resource "hcloud_server" "servers" {

network {
network_id = hcloud_network.internal.id
# work around https://github.com/hetznercloud/terraform-provider-hcloud/issues/650
alias_ips = []
}

public_net {
Expand All @@ -170,6 +177,10 @@ resource "hcloud_server" "servers" {
server_type = each.value.server_type,
})

lifecycle {
ignore_changes = [user_data]
}

backups = each.value.backup == 1 ? true : false

# important as per hcloud docs as there's a race condition otherwise
Expand Down

0 comments on commit 0b002f9

Please sign in to comment.