feat: initial commit
- have been working on this for some time now
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
resource "incus_profile" "this" {
|
||||
name = var.name
|
||||
description = var.description
|
||||
project = var.project
|
||||
config = var.config
|
||||
|
||||
dynamic "device" {
|
||||
for_each = var.devices
|
||||
content {
|
||||
name = device.value.name
|
||||
type = device.value.type
|
||||
properties = device.value.properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
output "name" {
|
||||
description = "Name of the created Incus profile"
|
||||
value = incus_profile.this.name
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
variable "name" {
|
||||
description = "Name of the Incus profile"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "description" {
|
||||
description = "Optional description of the profile"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "project" {
|
||||
description = "Project where the profile will be created"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "config" {
|
||||
description = "Map of Incus profile configuration settings"
|
||||
type = map(string)
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "devices" {
|
||||
description = <<EOT
|
||||
List of device blocks. Each device is a map with:
|
||||
- name (string)
|
||||
- type (string)
|
||||
- properties (map(string))
|
||||
EOT
|
||||
type = list(object({
|
||||
name = string
|
||||
type = string
|
||||
properties = map(string)
|
||||
}))
|
||||
default = []
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
incus = {
|
||||
source = "lxc/incus"
|
||||
version = "0.3.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user