homelab/tf/main.tf

113 lines
3.2 KiB
HCL

locals {
dns_server_ip = "10.0.123.123"
dns_server_subnet = "16"
}
resource "proxmox_virtual_environment_pool" "core" {
comment = "Managed by Terraform"
pool_id = "core"
}
module "dns_server" {
source = "./modules/dns-server"
vm_id = "200"
ipv4_address = "${local.dns_server_ip}/${local.dns_server_subnet}"
pool_id = proxmox_virtual_environment_pool.core.id
proxmox_vm_storage = var.proxmox_vm_storage
proxmox_image_storage = var.proxmox_image_storage
cloud_init_file_id = proxmox_virtual_environment_file.common_cloud_init.id
cloud_image_id = proxmox_virtual_environment_file.ubuntu_cloud_image.id
ssh_private_key_file = var.ssh_private_key_file
}
module "docker_swarm_stingray" {
source = "./modules/docker-swarm"
swarm_name = "stingray"
vm_id_prefix = "8"
subnet_cidr = "10.0.42.0/24"
gateway = var.gateway
manager_count = 3
worker_count = 3
dns_server_ip = local.dns_server_ip
proxmox_vm_storage = var.proxmox_vm_storage
proxmox_image_storage = var.proxmox_image_storage
cloud_init_file_id = proxmox_virtual_environment_file.common_cloud_init.id
cloud_image_id = proxmox_virtual_environment_file.ubuntu_cloud_image.id
ssh_private_key_file = var.ssh_private_key_file
}
module "k8s_dolo" {
source = "./modules/k8s"
started = true
cluster_name = "dolo"
vm_id_prefix = "1"
subnet_cidr = "10.0.185.0/24"
gateway = var.gateway
control_plane_count = 3
worker_count = 3
storage_worker_count = 3
storage_size = 32
dns_server_ip = local.dns_server_ip
proxmox_vm_storage = var.proxmox_vm_storage
proxmox_image_storage = var.proxmox_image_storage
cloud_init_file_id = proxmox_virtual_environment_file.common_cloud_init.id
cloud_image_id = proxmox_virtual_environment_file.ubuntu_cloud_image.id
ssh_private_key_file = var.ssh_private_key_file
}
module "k8s_folly" {
source = "./modules/k8s"
started = false
cluster_name = "folly"
vm_id_prefix = "2"
subnet_cidr = "10.0.186.0/24"
control_plane_count = 0
worker_count = 0
storage_worker_count = 0
dns_server_ip = local.dns_server_ip
proxmox_vm_storage = var.proxmox_vm_storage
proxmox_image_storage = var.proxmox_image_storage
cloud_init_file_id = proxmox_virtual_environment_file.common_cloud_init.id
cloud_image_id = proxmox_virtual_environment_file.ubuntu_cloud_image.id
ssh_private_key_file = var.ssh_private_key_file
}
module "flock_moirai" {
source = "./modules/flock"
flock_name = "moirai"
vm_id_prefix = "9"
subnet_cidr = "10.0.29.0/24"
gateway = var.gateway
wing_names = ["clotho", "lachesis", "atropos"]
dns_server_ip = local.dns_server_ip
proxmox_vm_storage = var.proxmox_vm_storage
proxmox_image_storage = var.proxmox_image_storage
cloud_init_file_id = proxmox_virtual_environment_file.common_cloud_init.id
cloud_image_id = proxmox_virtual_environment_file.ubuntu_cloud_image.id
ssh_private_key_file = var.ssh_private_key_file
}
module "embassy" {
source = "./modules/embassy"
ssh_public_key_file = var.ssh_public_key_file
cloudflare_zone_id = var.cloudflare_zone_id
}