feat: initial commit
- have been working on this for some time now
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
module "image" {
|
||||
source = "../../../../../../modules/image"
|
||||
|
||||
for_each = var.images
|
||||
|
||||
name = each.key
|
||||
remote = lookup(each.value, "remote")
|
||||
architecture = lookup(each.value, "architecture", null)
|
||||
}
|
||||
|
||||
module "network" {
|
||||
source = "../../../../../../modules/network"
|
||||
|
||||
for_each = var.networks
|
||||
|
||||
name = each.key
|
||||
type = lookup(each.value, "type")
|
||||
config = lookup(each.value, "config", {})
|
||||
}
|
||||
|
||||
module "profile" {
|
||||
source = "../../../../../../modules/profile"
|
||||
|
||||
for_each = var.profiles
|
||||
|
||||
name = each.key
|
||||
description = lookup(each.value, "description", null)
|
||||
project = lookup(each.value, "project", null)
|
||||
config = lookup(each.value, "config", {})
|
||||
devices = lookup(each.value, "devices", [])
|
||||
}
|
||||
|
||||
module "storage_pool" {
|
||||
source = "../../../../../../modules/storage_pool"
|
||||
|
||||
for_each = var.storage_pools
|
||||
|
||||
name = each.key
|
||||
description = lookup(each.value, "description", null)
|
||||
project = lookup(each.value, "project", null)
|
||||
driver = lookup(each.value, "driver")
|
||||
config = lookup(each.value, "config", {})
|
||||
}
|
||||
|
||||
module "storage_volume" {
|
||||
source = "../../../../../../modules/storage_volume"
|
||||
|
||||
for_each = var.storage_volumes
|
||||
|
||||
name = each.key
|
||||
pool = each.value.pool
|
||||
description = lookup(each.value, "description", null)
|
||||
type = lookup(each.value, "type", "custom")
|
||||
content_type = lookup(each.value, "content_type", null)
|
||||
config = lookup(each.value, "config", {})
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
variable "node_name" {
|
||||
type = string
|
||||
description = "Name of the node. This is used to fetch the corresponding token from Vault."
|
||||
}
|
||||
|
||||
variable "node_addr" {
|
||||
type = string
|
||||
description = "The address of the Incus node."
|
||||
}
|
||||
|
||||
variable "node_port" {
|
||||
type = string
|
||||
description = "The port Incus is listening on."
|
||||
default = "8443"
|
||||
}
|
||||
|
||||
variable "images" {
|
||||
description = "A map of images to be imported on this host"
|
||||
type = map(object({
|
||||
remote = string
|
||||
architecture = optional(string)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "networks" {
|
||||
description = "A map of networks to be imported on this host"
|
||||
type = map(object({
|
||||
type = string
|
||||
config = optional(map(string))
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "profiles" {
|
||||
description = "A map of profiles to be imported on this host"
|
||||
type = map(object({
|
||||
description = optional(string, null)
|
||||
project = optional(string, null)
|
||||
config = optional(map(string), {})
|
||||
devices = optional(list(object({
|
||||
name = string
|
||||
type = string
|
||||
properties = optional(map(string))
|
||||
network = optional(string)
|
||||
})), [])
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "storage_pools" {
|
||||
description = "A map of storage pools to be created on this host"
|
||||
type = map(object({
|
||||
driver = string # Required
|
||||
description = optional(string, null) # Optional
|
||||
project = optional(string, null) # Optional
|
||||
config = optional(map(string), {}) # Optional
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "storage_volumes" {
|
||||
description = "A map of storage volumes to be created on this host"
|
||||
type = map(object({
|
||||
pool = string # Required
|
||||
description = optional(string, null) # Optional
|
||||
type = optional(string, "custom") # Optional
|
||||
content_type = optional(string, "filesystem") # Optional
|
||||
config = optional(map(string), {}) # Optional
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
Reference in New Issue
Block a user