fix: move profile to module
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user