fix: move profile to module

This commit is contained in:
2026-06-26 23:44:30 +01:00
parent fba3827961
commit 83abf1f978
3 changed files with 47 additions and 32 deletions
+9 -31
View File
@@ -32,35 +32,9 @@ resource "incus_image" "this" {
}
}
resource "incus_profile" "this" {
name = "Default"
description = "The default profile applied to both masters and workers."
project = incus_project.this.name
depends_on = [incus_network.this]
config = {
"limits.cpu" = var.cpus
"limits.memory" = var.memory
"boot.autostart" = false
"security.secureboot" = false
}
device {
name = "root"
type = "disk"
properties = {
"pool" = "default"
"path" = "/"
"size" = local.root_disk_size
}
}
}
resource "incus_network" "this" {
name = "deskpi-cluster"
description = "An emulated network for the DeskPi Super6C cluster project."
name = "home-infrastructure"
description = "An emulated home infrastructure stack."
project = incus_project.this.name
type = "bridge"
@@ -77,19 +51,23 @@ module "master" {
name = "master-${count.index}"
project = incus_project.this.name
image = incus_image.this.fingerprint
profiles = [incus_profile.this.name]
cpu = 2
memory = "2GiB"
network = incus_network.this.name
ipv4_address = cidrhost(local.network_cidr, 2 + (2 * count.index))
}
module "worker" {
source = "./modules/incus_vm"
count = local.master_count
count = local.worker_count
name = "worker-${count.index}"
project = incus_project.this.name
image = incus_image.this.fingerprint
profiles = [incus_profile.this.name]
cpu = 2
memory = "2GiB"
network = incus_network.this.name
ipv4_address = cidrhost(local.network_cidr, 3 + (2 * count.index))
}