81 lines
2 KiB
HCL
81 lines
2 KiB
HCL
variable "cluster_name" {
|
|
description = "A name prefix for the cluster resources."
|
|
type = string
|
|
default = "k3s"
|
|
}
|
|
|
|
variable "libvirt_uri" {
|
|
description = "Libvirt connection URI."
|
|
type = string
|
|
default = "qemu:///system"
|
|
}
|
|
|
|
# --- Base Image ---
|
|
variable "base_image_url" {
|
|
description = "URL of the cloud image to download (e.g., Fedora Cloud Base)."
|
|
type = string
|
|
default = "https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2"
|
|
}
|
|
|
|
variable "base_image_name" {
|
|
description = "Name for the base image volume in libvirt pool."
|
|
type = string
|
|
default = "fedora-cloud-base.qcow2"
|
|
}
|
|
|
|
variable "libvirt_pool" {
|
|
description = "Name of the libvirt storage pool to use."
|
|
type = string
|
|
default = "default"
|
|
}
|
|
|
|
# --- VM Common Settings ---
|
|
variable "ssh_public_key_path" {
|
|
description = "Path to your public SSH key for accessing the VMs."
|
|
type = string
|
|
default = "~/.ssh/id_cluster.pub"
|
|
}
|
|
|
|
variable "vm_user" {
|
|
description = "Default user to create in the VMs via cloud-init."
|
|
type = string
|
|
default = "fedora"
|
|
}
|
|
|
|
variable "vm_memory" {
|
|
description = "Memory for each VM in MiB."
|
|
type = number
|
|
default = 2048
|
|
}
|
|
|
|
variable "vm_vcpu" {
|
|
description = "Number of virtual CPUs for each VM."
|
|
type = number
|
|
default = 2
|
|
}
|
|
|
|
variable "vm_disk_size" {
|
|
description = "Disk size for each VM's root volume in bytes."
|
|
type = number
|
|
default = 21474836480
|
|
}
|
|
|
|
# --- Network ---
|
|
variable "libvirt_network_name" {
|
|
description = "Name of the libvirt network to connect VMs to."
|
|
type = string
|
|
default = "default"
|
|
}
|
|
|
|
# --- Node Specific ---
|
|
variable "server_hostname" {
|
|
description = "Hostname for the K3s server node."
|
|
type = string
|
|
default = "k3s-server"
|
|
}
|
|
|
|
variable "agent_hostname" {
|
|
description = "Hostname for the K3s agent node."
|
|
type = string
|
|
default = "k3s-agent-01"
|
|
}
|