mirror of
https://github.com/outbackdingo/homelab-v.git
synced 2026-08-25 14:53:19 +00:00
chore(tofu): run tofu fmt on configuration
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
resource "null_resource" "haos_image" {
|
resource "null_resource" "haos_image" {
|
||||||
triggers = {
|
triggers = {
|
||||||
on_version_change = var.haos_version
|
on_version_change = var.haos_version
|
||||||
filename = var.local_file
|
filename = var.local_file
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = "curl -s -L ${var.haos_download_url}/${var.haos_version}/haos_ova-${var.haos_version}.qcow2.xz | xz -d > ${var.local_file}"
|
command = "curl -s -L ${var.haos_download_url}/${var.haos_version}/haos_ova-${var.haos_version}.qcow2.xz | xz -d > ${var.local_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
when = destroy
|
when = destroy
|
||||||
command = "rm ${self.triggers.filename}"
|
command = "rm ${self.triggers.filename}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_file" "haos_generic_image" {
|
resource "proxmox_virtual_environment_file" "haos_generic_image" {
|
||||||
depends_on = [null_resource.haos_image]
|
depends_on = [null_resource.haos_image]
|
||||||
node_name = var.proxmox_cluster.name
|
node_name = var.proxmox_cluster.name
|
||||||
datastore_id = var.proxmox_cluster.image_datastore
|
datastore_id = var.proxmox_cluster.image_datastore
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ proxmox_cluster = {
|
|||||||
image_datastore = "local"
|
image_datastore = "local"
|
||||||
}
|
}
|
||||||
|
|
||||||
haos_version = "12.4"
|
haos_version = "12.4"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ variable "proxmox_cluster" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "proxmox_api_token" {
|
variable "proxmox_api_token" {
|
||||||
type = string
|
type = string
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ resource "proxmox_virtual_environment_vm" "home_assistant" {
|
|||||||
|
|
||||||
name = "Home-Assistant"
|
name = "Home-Assistant"
|
||||||
description = "Managed by OpenTofu"
|
description = "Managed by OpenTofu"
|
||||||
tags = ["home-assistant"]
|
tags = ["home-assistant"]
|
||||||
on_boot = true
|
on_boot = true
|
||||||
bios = "ovmf"
|
bios = "ovmf"
|
||||||
scsi_hardware = "virtio-scsi-single"
|
scsi_hardware = "virtio-scsi-single"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ resource "kubernetes_namespace" "sealed-secrets" {
|
|||||||
|
|
||||||
resource "kubernetes_secret" "sealed-secrets-key" {
|
resource "kubernetes_secret" "sealed-secrets-key" {
|
||||||
depends_on = [kubernetes_namespace.sealed-secrets]
|
depends_on = [kubernetes_namespace.sealed-secrets]
|
||||||
type = "kubernetes.io/tls"
|
type = "kubernetes.io/tls"
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
name = "sealed-secrets-bootstrap-key"
|
name = "sealed-secrets-bootstrap-key"
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
variable "volume" {
|
variable "volume" {
|
||||||
description = "Volume configuration"
|
description = "Volume configuration"
|
||||||
type = object({
|
type = object({
|
||||||
name = string
|
name = string
|
||||||
capacity = string
|
capacity = string
|
||||||
volume_handle = string
|
volume_handle = string
|
||||||
access_modes = optional(list(string), ["ReadWriteOnce"])
|
access_modes = optional(list(string), ["ReadWriteOnce"])
|
||||||
storage_class_name = optional(string, "proxmox-csi")
|
storage_class_name = optional(string, "proxmox-csi")
|
||||||
fs_type = optional(string, "ext4")
|
fs_type = optional(string, "ext4")
|
||||||
driver = optional(string, "csi.proxmox.sinextra.dev")
|
driver = optional(string, "csi.proxmox.sinextra.dev")
|
||||||
volume_mode = optional(string, "Filesystem")
|
volume_mode = optional(string, "Filesystem")
|
||||||
mount_options = optional(list(string), ["noatime"])
|
mount_options = optional(list(string), ["noatime"])
|
||||||
cache = optional(string, "writethrough")
|
cache = optional(string, "writethrough")
|
||||||
ssd = optional(bool, true)
|
ssd = optional(bool, true)
|
||||||
storage = optional(string, "local-zfs")
|
storage = optional(string, "local-zfs")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
variable "volume" {
|
variable "volume" {
|
||||||
type = object({
|
type = object({
|
||||||
name = string
|
name = string
|
||||||
node = string
|
node = string
|
||||||
size = string
|
size = string
|
||||||
storage = optional(string, "local-zfs")
|
storage = optional(string, "local-zfs")
|
||||||
vmid = optional(number, 9999)
|
vmid = optional(number, 9999)
|
||||||
format = optional(string, "raw")
|
format = optional(string, "raw")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ variable "proxmox_api" {
|
|||||||
variable "volumes" {
|
variable "volumes" {
|
||||||
type = map(
|
type = map(
|
||||||
object({
|
object({
|
||||||
node = string
|
node = string
|
||||||
size = string
|
size = string
|
||||||
storage = optional(string, "local-zfs")
|
storage = optional(string, "local-zfs")
|
||||||
vmid = optional(number, 9999)
|
vmid = optional(number, 9999)
|
||||||
format = optional(string, "raw")
|
format = optional(string, "raw")
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module "talos" {
|
|||||||
|
|
||||||
module "sealed_secrets" {
|
module "sealed_secrets" {
|
||||||
depends_on = [module.talos]
|
depends_on = [module.talos]
|
||||||
source = "./bootstrap/sealed-secrets"
|
source = "./bootstrap/sealed-secrets"
|
||||||
|
|
||||||
providers = {
|
providers = {
|
||||||
kubernetes = kubernetes
|
kubernetes = kubernetes
|
||||||
@@ -23,7 +23,7 @@ module "sealed_secrets" {
|
|||||||
|
|
||||||
module "proxmox_csi_plugin" {
|
module "proxmox_csi_plugin" {
|
||||||
depends_on = [module.talos]
|
depends_on = [module.talos]
|
||||||
source = "./bootstrap/proxmox-csi-plugin"
|
source = "./bootstrap/proxmox-csi-plugin"
|
||||||
|
|
||||||
providers = {
|
providers = {
|
||||||
proxmox = proxmox
|
proxmox = proxmox
|
||||||
@@ -35,7 +35,7 @@ module "proxmox_csi_plugin" {
|
|||||||
|
|
||||||
module "volumes" {
|
module "volumes" {
|
||||||
depends_on = [module.proxmox_csi_plugin]
|
depends_on = [module.proxmox_csi_plugin]
|
||||||
source = "./bootstrap/volumes"
|
source = "./bootstrap/volumes"
|
||||||
|
|
||||||
providers = {
|
providers = {
|
||||||
restapi = restapi
|
restapi = restapi
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ provider "restapi" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
provider "kubernetes" {
|
provider "kubernetes" {
|
||||||
host = module.talos.kube_config.kubernetes_client_configuration.host
|
host = module.talos.kube_config.kubernetes_client_configuration.host
|
||||||
client_certificate = base64decode(module.talos.kube_config.kubernetes_client_configuration.client_certificate)
|
client_certificate = base64decode(module.talos.kube_config.kubernetes_client_configuration.client_certificate)
|
||||||
client_key = base64decode(module.talos.kube_config.kubernetes_client_configuration.client_key)
|
client_key = base64decode(module.talos.kube_config.kubernetes_client_configuration.client_key)
|
||||||
cluster_ca_certificate = base64decode(module.talos.kube_config.kubernetes_client_configuration.ca_certificate)
|
cluster_ca_certificate = base64decode(module.talos.kube_config.kubernetes_client_configuration.ca_certificate)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
locals {
|
locals {
|
||||||
first_control_plane_node_ip = [for k, v in var.nodes : v.ip if v.machine_type == "controlplane"][0]
|
first_control_plane_node_ip = [for k, v in var.nodes : v.ip if v.machine_type == "controlplane"][0]
|
||||||
kubernetes_endpoint = coalesce(var.cluster.vip, local.first_control_plane_node_ip)
|
kubernetes_endpoint = coalesce(var.cluster.vip, local.first_control_plane_node_ip)
|
||||||
extra_manifests = concat(var.cluster.extra_manifests, [
|
extra_manifests = concat(var.cluster.extra_manifests, [
|
||||||
"https://github.com/kubernetes-sigs/gateway-api/releases/download/${var.cluster.gateway_api_version}/standard-install.yaml",
|
"https://github.com/kubernetes-sigs/gateway-api/releases/download/${var.cluster.gateway_api_version}/standard-install.yaml",
|
||||||
"https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${var.cluster.gateway_api_version}/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml"
|
"https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${var.cluster.gateway_api_version}/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml"
|
||||||
@@ -21,7 +21,7 @@ data "talos_client_configuration" "this" {
|
|||||||
resource "terraform_data" "cilium_bootstrap_inline_manifests" {
|
resource "terraform_data" "cilium_bootstrap_inline_manifests" {
|
||||||
input = [
|
input = [
|
||||||
{
|
{
|
||||||
name = "cilium-bootstrap"
|
name = "cilium-bootstrap"
|
||||||
contents = file("${path.root}/${var.cluster.cilium.bootstrap_manifest_path}")
|
contents = file("${path.root}/${var.cluster.cilium.bootstrap_manifest_path}")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -42,8 +42,8 @@ resource "terraform_data" "cilium_bootstrap_inline_manifests" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "talos_machine_configuration" "this" {
|
data "talos_machine_configuration" "this" {
|
||||||
for_each = var.nodes
|
for_each = var.nodes
|
||||||
cluster_name = var.cluster.name
|
cluster_name = var.cluster.name
|
||||||
# This is the Kubernetes API Server endpoint.
|
# This is the Kubernetes API Server endpoint.
|
||||||
# ref - https://www.talos.dev/latest/introduction/prodnotes/#decide-the-kubernetes-endpoint
|
# ref - https://www.talos.dev/latest/introduction/prodnotes/#decide-the-kubernetes-endpoint
|
||||||
cluster_endpoint = "https://${local.kubernetes_endpoint}:6443"
|
cluster_endpoint = "https://${local.kubernetes_endpoint}:6443"
|
||||||
@@ -59,22 +59,22 @@ data "talos_machine_configuration" "this" {
|
|||||||
kubernetes_version = var.cluster.kubernetes_version
|
kubernetes_version = var.cluster.kubernetes_version
|
||||||
hostname = each.key
|
hostname = each.key
|
||||||
ip = each.value.ip
|
ip = each.value.ip
|
||||||
mac_address = lower(each.value.mac_address)
|
mac_address = lower(each.value.mac_address)
|
||||||
gateway = var.cluster.gateway
|
gateway = var.cluster.gateway
|
||||||
subnet_mask = var.cluster.subnet_mask
|
subnet_mask = var.cluster.subnet_mask
|
||||||
vip = var.cluster.vip
|
vip = var.cluster.vip
|
||||||
}), each.value.machine_type == "controlplane" ?
|
}), each.value.machine_type == "controlplane" ?
|
||||||
templatefile("${path.module}/machine-config/control-plane.yaml.tftpl", {
|
templatefile("${path.module}/machine-config/control-plane.yaml.tftpl", {
|
||||||
kubelet = var.cluster.kubelet
|
kubelet = var.cluster.kubelet
|
||||||
extra_manifests = jsonencode(local.extra_manifests)
|
extra_manifests = jsonencode(local.extra_manifests)
|
||||||
api_server = var.cluster.api_server
|
api_server = var.cluster.api_server
|
||||||
inline_manifests = jsonencode(terraform_data.cilium_bootstrap_inline_manifests.output)
|
inline_manifests = jsonencode(terraform_data.cilium_bootstrap_inline_manifests.output)
|
||||||
}) : ""
|
}) : ""
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "talos_machine_configuration_apply" "this" {
|
resource "talos_machine_configuration_apply" "this" {
|
||||||
depends_on = [proxmox_virtual_environment_vm.this]
|
depends_on = [proxmox_virtual_environment_vm.this]
|
||||||
for_each = var.nodes
|
for_each = var.nodes
|
||||||
node = each.value.ip
|
node = each.value.ip
|
||||||
client_configuration = talos_machine_secrets.this.client_configuration
|
client_configuration = talos_machine_secrets.this.client_configuration
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
locals {
|
locals {
|
||||||
version = var.image.version
|
version = var.image.version
|
||||||
schematic = file("${path.root}/${var.image.schematic_path}")
|
schematic = file("${path.root}/${var.image.schematic_path}")
|
||||||
schematic_id = jsondecode(data.http.schematic_id.response_body)["id"]
|
schematic_id = jsondecode(data.http.schematic_id.response_body)["id"]
|
||||||
|
|
||||||
update_version = coalesce(var.image.update_version, var.image.version)
|
update_version = coalesce(var.image.update_version, var.image.version)
|
||||||
update_schematic_path = coalesce(var.image.update_schematic_path, var.image.schematic_path)
|
update_schematic_path = coalesce(var.image.update_schematic_path, var.image.schematic_path)
|
||||||
update_schematic = file("${path.root}/${local.update_schematic_path}")
|
update_schematic = file("${path.root}/${local.update_schematic_path}")
|
||||||
update_schematic_id = jsondecode(data.http.updated_schematic_id.response_body)["id"]
|
update_schematic_id = jsondecode(data.http.updated_schematic_id.response_body)["id"]
|
||||||
|
|
||||||
image_id = "${local.schematic_id}_${local.version}"
|
image_id = "${local.schematic_id}_${local.version}"
|
||||||
update_image_id = "${local.update_schematic_id}_${local.update_version}"
|
update_image_id = "${local.update_schematic_id}_${local.update_version}"
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
variable "image" {
|
variable "image" {
|
||||||
description = "Talos image configuration"
|
description = "Talos image configuration"
|
||||||
type = object({
|
type = object({
|
||||||
factory_url = optional(string, "https://factory.talos.dev")
|
factory_url = optional(string, "https://factory.talos.dev")
|
||||||
schematic_path = string
|
schematic_path = string
|
||||||
version = string
|
version = string
|
||||||
update_schematic_path = optional(string)
|
update_schematic_path = optional(string)
|
||||||
update_version = optional(string)
|
update_version = optional(string)
|
||||||
arch = optional(string, "amd64")
|
arch = optional(string, "amd64")
|
||||||
platform = optional(string, "nocloud")
|
platform = optional(string, "nocloud")
|
||||||
proxmox_datastore = optional(string, "local")
|
proxmox_datastore = optional(string, "local")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "cluster" {
|
variable "cluster" {
|
||||||
description = "Cluster configuration"
|
description = "Cluster configuration"
|
||||||
type = object({
|
type = object({
|
||||||
name = string
|
name = string
|
||||||
vip = optional(string)
|
vip = optional(string)
|
||||||
gateway = string
|
gateway = string
|
||||||
subnet_mask = optional(string, "24")
|
subnet_mask = optional(string, "24")
|
||||||
talos_machine_config_version = optional(string)
|
talos_machine_config_version = optional(string)
|
||||||
proxmox_cluster = string
|
proxmox_cluster = string
|
||||||
kubernetes_version = string
|
kubernetes_version = string
|
||||||
gateway_api_version = string
|
gateway_api_version = string
|
||||||
extra_manifests = optional(list(string))
|
extra_manifests = optional(list(string))
|
||||||
kubelet = optional(string)
|
kubelet = optional(string)
|
||||||
api_server = optional(string)
|
api_server = optional(string)
|
||||||
cilium = object({
|
cilium = object({
|
||||||
bootstrap_manifest_path = string
|
bootstrap_manifest_path = string
|
||||||
values_file_path = string
|
values_file_path = string
|
||||||
@@ -38,14 +38,14 @@ variable "nodes" {
|
|||||||
type = map(object({
|
type = map(object({
|
||||||
host_node = string
|
host_node = string
|
||||||
machine_type = string
|
machine_type = string
|
||||||
datastore_id = optional(string, "local-zfs")
|
datastore_id = optional(string, "local-zfs")
|
||||||
ip = string
|
ip = string
|
||||||
dns = optional(list(string))
|
dns = optional(list(string))
|
||||||
mac_address = string
|
mac_address = string
|
||||||
vm_id = number
|
vm_id = number
|
||||||
cpu = number
|
cpu = number
|
||||||
ram_dedicated = number
|
ram_dedicated = number
|
||||||
update = optional(bool, false)
|
update = optional(bool, false)
|
||||||
igpu = optional(bool, false)
|
igpu = optional(bool, false)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
talos_cluster_config = {
|
talos_cluster_config = {
|
||||||
name = "talos"
|
name = "talos"
|
||||||
# Only use a VIP if the nodes share a layer 2 network
|
# Only use a VIP if the nodes share a layer 2 network
|
||||||
# Ref: https://www.talos.dev/v1.9/talos-guides/network/vip/#requirements
|
# Ref: https://www.talos.dev/v1.9/talos-guides/network/vip/#requirements
|
||||||
vip = "192.168.1.99"
|
vip = "192.168.1.99"
|
||||||
gateway = "192.168.1.1"
|
gateway = "192.168.1.1"
|
||||||
# The version of talos features to use in generated machine configuration. Generally the same as image version.
|
# The version of talos features to use in generated machine configuration. Generally the same as image version.
|
||||||
# See https://github.com/siderolabs/terraform-provider-talos/blob/main/docs/data-sources/machine_configuration.md
|
# See https://github.com/siderolabs/terraform-provider-talos/blob/main/docs/data-sources/machine_configuration.md
|
||||||
# Uncomment to use this instead of version from talos_image.
|
# Uncomment to use this instead of version from talos_image.
|
||||||
# talos_machine_config_version = "v1.9.2"
|
# talos_machine_config_version = "v1.9.2"
|
||||||
proxmox_cluster = "homelab"
|
proxmox_cluster = "homelab"
|
||||||
kubernetes_version = "v1.32.3" # renovate: github-releases=kubernetes/kubernetes
|
kubernetes_version = "v1.32.3" # renovate: github-releases=kubernetes/kubernetes
|
||||||
cilium = {
|
cilium = {
|
||||||
bootstrap_manifest_path = "talos/inline-manifests/cilium-install.yaml"
|
bootstrap_manifest_path = "talos/inline-manifests/cilium-install.yaml"
|
||||||
values_file_path = "../../k8s/infra/network/cilium/values.yaml"
|
values_file_path = "../../k8s/infra/network/cilium/values.yaml"
|
||||||
}
|
}
|
||||||
gateway_api_version = "v1.2.1" # renovate: github-releases=kubernetes-sigs/gateway-api
|
gateway_api_version = "v1.2.1" # renovate: github-releases=kubernetes-sigs/gateway-api
|
||||||
extra_manifests = []
|
extra_manifests = []
|
||||||
kubelet = <<-EOT
|
kubelet = <<-EOT
|
||||||
extraArgs:
|
extraArgs:
|
||||||
# Needed for Netbird agent https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#enabling-unsafe-sysctls
|
# Needed for Netbird agent https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#enabling-unsafe-sysctls
|
||||||
allowed-unsafe-sysctls: net.ipv4.conf.all.src_valid_mark
|
allowed-unsafe-sysctls: net.ipv4.conf.all.src_valid_mark
|
||||||
EOT
|
EOT
|
||||||
api_server = <<-EOT
|
api_server = <<-EOT
|
||||||
extraArgs:
|
extraArgs:
|
||||||
oidc-issuer-url: "https://authelia.stonegarden.dev"
|
oidc-issuer-url: "https://authelia.stonegarden.dev"
|
||||||
oidc-client-id: "kubectl"
|
oidc-client-id: "kubectl"
|
||||||
|
|||||||
@@ -18,30 +18,30 @@ variable "proxmox_api_token" {
|
|||||||
variable "talos_image" {
|
variable "talos_image" {
|
||||||
description = "Talos image configuration"
|
description = "Talos image configuration"
|
||||||
type = object({
|
type = object({
|
||||||
factory_url = optional(string, "https://factory.talos.dev")
|
factory_url = optional(string, "https://factory.talos.dev")
|
||||||
version = string
|
version = string
|
||||||
schematic_path = string
|
schematic_path = string
|
||||||
update_version = optional(string)
|
update_version = optional(string)
|
||||||
update_schematic_path = optional(string)
|
update_schematic_path = optional(string)
|
||||||
arch = optional(string, "amd64")
|
arch = optional(string, "amd64")
|
||||||
platform = optional(string, "nocloud")
|
platform = optional(string, "nocloud")
|
||||||
proxmox_datastore = optional(string, "local")
|
proxmox_datastore = optional(string, "local")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "talos_cluster_config" {
|
variable "talos_cluster_config" {
|
||||||
description = "Talos cluster configuration"
|
description = "Talos cluster configuration"
|
||||||
type = object({
|
type = object({
|
||||||
name = string
|
name = string
|
||||||
vip = optional(string)
|
vip = optional(string)
|
||||||
gateway = string
|
gateway = string
|
||||||
talos_machine_config_version = optional(string)
|
talos_machine_config_version = optional(string)
|
||||||
proxmox_cluster = string
|
proxmox_cluster = string
|
||||||
kubernetes_version = string
|
kubernetes_version = string
|
||||||
gateway_api_version = string
|
gateway_api_version = string
|
||||||
extra_manifests = optional(list(string), [])
|
extra_manifests = optional(list(string), [])
|
||||||
kubelet = optional(string)
|
kubelet = optional(string)
|
||||||
api_server = optional(string)
|
api_server = optional(string)
|
||||||
cilium = object({
|
cilium = object({
|
||||||
bootstrap_manifest_path = string
|
bootstrap_manifest_path = string
|
||||||
values_file_path = string
|
values_file_path = string
|
||||||
@@ -55,18 +55,18 @@ variable "talos_nodes" {
|
|||||||
host_node = string
|
host_node = string
|
||||||
machine_type = string
|
machine_type = string
|
||||||
ip = string
|
ip = string
|
||||||
dns = optional(list(string))
|
dns = optional(list(string))
|
||||||
mac_address = string
|
mac_address = string
|
||||||
vm_id = number
|
vm_id = number
|
||||||
cpu = number
|
cpu = number
|
||||||
ram_dedicated = number
|
ram_dedicated = number
|
||||||
update = optional(bool, false)
|
update = optional(bool, false)
|
||||||
igpu = optional(bool, false)
|
igpu = optional(bool, false)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
validation {
|
validation {
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
condition = length([for n in var.talos_nodes : n if contains(["controlplane", "worker"], n.machine_type)]) == length(var.talos_nodes)
|
condition = length([for n in var.talos_nodes : n if contains(["controlplane", "worker"], n.machine_type)]) == length(var.talos_nodes)
|
||||||
error_message = "Node machine_type must be either 'controlplane' or 'worker'."
|
error_message = "Node machine_type must be either 'controlplane' or 'worker'."
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
@@ -83,11 +83,11 @@ variable "sealed_secrets_config" {
|
|||||||
variable "kubernetes_volumes" {
|
variable "kubernetes_volumes" {
|
||||||
type = map(
|
type = map(
|
||||||
object({
|
object({
|
||||||
node = string
|
node = string
|
||||||
size = string
|
size = string
|
||||||
storage = optional(string, "local-zfs")
|
storage = optional(string, "local-zfs")
|
||||||
vmid = optional(number, 9999)
|
vmid = optional(number, 9999)
|
||||||
format = optional(string, "raw")
|
format = optional(string, "raw")
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user