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
+25 -1
View File
@@ -14,7 +14,7 @@ resource "incus_instance" "this" {
type = "virtual-machine"
image = var.image
profiles = var.profiles
profiles = concat([incus_profile.this.name], var.profiles)
wait_for {
type = "agent"
@@ -53,3 +53,27 @@ resource "incus_storage_volume" "this" {
"size" = "16GiB"
}
}
resource "incus_profile" "this" {
name = var.name
description = "Default profile for ${var.name}"
project = var.project
config = {
"limits.cpu" = var.cpu
"limits.memory" = var.memory
"boot.autostart" = false
"security.secureboot" = true
}
device {
name = "root"
type = "disk"
properties = {
"pool" = "default"
"path" = "/"
"size" = "16GiB"
}
}
}