Remove hcloud servers

This commit is contained in:
Paul-Henri Froidmont 2024-12-18 11:21:45 +01:00
parent 7c1f95f11b
commit d43684fde5
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
4 changed files with 1 additions and 110 deletions

View file

@ -24,7 +24,7 @@
};
services.monit = {
enable = true;
enable = false;
additionalConfig = ''
check program raid-md127 with path "${pkgs.mdadm}/bin/mdadm --misc --detail --test /dev/md127"
if status != 0 then alert

View file

@ -22,14 +22,6 @@ resource "hetznerdns_record" "banditlair_hcloud_a" {
ttl = 600
}
resource "hetznerdns_record" "backend1_a" {
zone_id = data.hetznerdns_zone.banditlair_zone.id
name = "backend1"
value = hcloud_server.backend1.ipv4_address
type = "A"
ttl = 600
}
resource "hetznerdns_record" "webmail_a" {
zone_id = data.hetznerdns_zone.banditlair_zone.id
name = "webmail"
@ -206,14 +198,6 @@ resource "hetznerdns_record" "cifirpg_a" {
ttl = 600
}
resource "hetznerdns_record" "db1_a" {
zone_id = data.hetznerdns_zone.banditlair_zone.id
name = "db1"
value = hcloud_server.db1.ipv4_address
type = "A"
ttl = 600
}
resource "hetznerdns_record" "banditlair_dedicated_a" {
zone_id = data.hetznerdns_zone.banditlair_zone.id
name = "*"

View file

@ -1,86 +0,0 @@
data "hcloud_image" "nixos_stable" {
with_selector = "nixos=21.05"
}
resource "hcloud_network" "private_network" {
name = "private"
ip_range = "10.0.0.0/16"
}
resource "hcloud_network_subnet" "db_network_subnet" {
type = "cloud"
network_id = hcloud_network.private_network.id
network_zone = "eu-central"
ip_range = "10.0.1.0/24"
}
resource "hcloud_network_subnet" "banditlair_vswitch_network_subnet" {
type = "vswitch"
network_id = hcloud_network.private_network.id
network_zone = "eu-central"
ip_range = "10.0.2.0/24"
vswitch_id = 29224
}
resource "hcloud_server" "db1" {
name = "db1"
image = data.hcloud_image.nixos_stable.id
server_type = "cpx11"
ssh_keys = [
hcloud_ssh_key.froidmpa-desktop.id
]
keep_disk = true
location = "fsn1"
network {
network_id = hcloud_network.private_network.id
ip = "10.0.1.11"
}
labels = {
type = "db"
}
depends_on = [
hcloud_network_subnet.db_network_subnet
]
lifecycle {
ignore_changes = [
ssh_keys,
image
]
}
}
resource "hcloud_server" "backend1" {
name = "backend1"
image = data.hcloud_image.nixos_stable.id
server_type = "cpx21"
ssh_keys = [
hcloud_ssh_key.froidmpa-desktop.id
]
keep_disk = true
location = "fsn1"
network {
network_id = hcloud_network.private_network.id
ip = "10.0.1.1"
}
labels = {
type = "backend"
}
depends_on = [
hcloud_network_subnet.db_network_subnet
]
lifecycle {
ignore_changes = [
ssh_keys,
image
]
}
}

View file

@ -1,7 +0,0 @@
output "db1_public_ip" {
value = hcloud_server.db1.ipv4_address
}
output "backend1_public_ip" {
value = hcloud_server.backend1.ipv4_address
}