Update 3 files

- /terraform/variables.tf
- /terraform/terraform.tfvars
- /terraform/main.tf
This commit is contained in:
2023-08-06 17:17:21 +00:00
parent 03d47ad04f
commit d1a83cb6f1
3 changed files with 9 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ resource "proxmox_vm_qemu" "k3master" {
count = var.k3master.count count = var.k3master.count
ciuser = "administrator" ciuser = "administrator"
vmid = "20${var.k3master.ip[count.index]}" vmid = "20${var.k3master.ip[count.index]}"
name = var.k3master.name[count.index] name = "${var.k3master.name[count.index]}-${var.environment}"
target_node = var.k3master.node[count.index] target_node = var.k3master.node[count.index]
clone = var.k3master.template clone = var.k3master.template
qemu_os = "other" qemu_os = "other"

View File

@@ -9,19 +9,17 @@ k3master = {
memory = "4096" memory = "4096"
drive = "20G" drive = "20G"
storage = "ssd-domains" storage = "ssd-domains"
template = var.template
node = ["overlord"] node = ["overlord"]
ip = ["10"] ip = ["10"]
} }
k3server = { k3server = {
count = 2 count = 3
name = ["node01", "node02"] name = ["node01", "node02", "node03"]
cores = 4 cores = 4
memory = "4096" memory = "4096"
drive = "60G" drive = "60G"
storage = "ssd-domains" storage = "ssd-domains"
template = var.template
node = ["mothership", "mothership"] node = ["mothership", "mothership"]
ip = ["20", "21"] ip = ["20", "21"]
} }

View File

@@ -24,6 +24,12 @@ variable "pm_user" {
default = "root@pam" default = "root@pam"
} }
variable "template: {
description = "Default Template to clone from"
type = string
default = "Debian12-Template"
}
variable "k3master" { variable "k3master" {
description = "Defaults of master nodes in K3S" description = "Defaults of master nodes in K3S"
type = object({ type = object({
@@ -33,7 +39,6 @@ variable "k3master" {
memory = number memory = number
drive = string drive = string
storage = string storage = string
template = string
node = list(string) node = list(string)
ip = list(number) ip = list(number)
}) })
@@ -48,7 +53,6 @@ variable "k3server" {
memory = number memory = number
drive = string drive = string
storage = string storage = string
template = string
node = list(string) node = list(string)
ip = list(number) ip = list(number)
}) })