feat: add variable master and worker counts
This commit is contained in:
+3
-7
@@ -3,14 +3,10 @@
|
||||
# ------
|
||||
|
||||
locals {
|
||||
image = "ubuntu/26.04"
|
||||
root_disk_size = "16GiB"
|
||||
ext_disk_size = "16GiB"
|
||||
network_cidr = "10.150.0.1/24"
|
||||
|
||||
master_count = 3
|
||||
worker_count = 0
|
||||
|
||||
image = "ubuntu/26.04"
|
||||
}
|
||||
|
||||
# ---------
|
||||
@@ -46,7 +42,7 @@ resource "incus_network" "this" {
|
||||
|
||||
module "master" {
|
||||
source = "./modules/incus_vm"
|
||||
count = local.master_count
|
||||
count = var.master_count
|
||||
|
||||
name = "master-${count.index}"
|
||||
project = incus_project.this.name
|
||||
@@ -60,7 +56,7 @@ module "master" {
|
||||
|
||||
module "worker" {
|
||||
source = "./modules/incus_vm"
|
||||
count = local.worker_count
|
||||
count = var.worker_count
|
||||
|
||||
name = "worker-${count.index}"
|
||||
project = incus_project.this.name
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
variable "master_count" {
|
||||
description = "The number of master nodes to provision."
|
||||
type = number
|
||||
default = 1
|
||||
nullable = false
|
||||
}
|
||||
|
||||
variable "worker_count" {
|
||||
description = "The number of worker nodes to provision."
|
||||
type = number
|
||||
default = 0
|
||||
nullable = false
|
||||
}
|
||||
|
||||
variable "cpus" {
|
||||
description = "The number of CPU cores allocated to each virtual machine."
|
||||
type = number
|
||||
|
||||
Reference in New Issue
Block a user