diff options
Diffstat (limited to 'opentofu/modules/k8s_control_plane')
-rw-r--r-- | opentofu/modules/k8s_control_plane/main.tf | 55 | ||||
-rw-r--r-- | opentofu/modules/k8s_control_plane/outputs.tf | 3 | ||||
-rw-r--r-- | opentofu/modules/k8s_control_plane/variables.tf | 25 | ||||
-rw-r--r-- | opentofu/modules/k8s_control_plane/versions.tf | 11 |
4 files changed, 94 insertions, 0 deletions
diff --git a/opentofu/modules/k8s_control_plane/main.tf b/opentofu/modules/k8s_control_plane/main.tf new file mode 100644 index 0000000..d8477af --- /dev/null +++ b/opentofu/modules/k8s_control_plane/main.tf @@ -0,0 +1,55 @@ +resource "proxmox_vm_qemu" "k8s_cp" { + lifecycle { + ignore_changes = [ + bootdisk, + ] + } + + name = var.name + desc = var.desc + agent = var.agent + target_node = var.target_node + tags = var.tags + + clone = var.clone + full_clone = var.full_clone + + qemu_os = var.qemu_os + cores = var.cores + sockets = var.sockets + cpu_type = var.cpu_type + memory = var.memory + + scsihw = var.scsihw + bootdisk = var.bootdisk + + disks { + ide { + ide0 { + cloudinit { + storage = var.cloudinit_storage + } + } + } + virtio { + virtio0 { + disk { + storage = var.disk_storage + size = var.disk_size + iothread = var.iothread + replicate = var.replicate + } + } + } + } + + network { + id = var.network_id + model = var.network_model + bridge = var.network_bridge + } + + ipconfig0 = var.ipconfig0 + ciuser = var.ciuser + sshkeys = var.sshkeys +} diff --git a/opentofu/modules/k8s_control_plane/outputs.tf b/opentofu/modules/k8s_control_plane/outputs.tf new file mode 100644 index 0000000..a081907 --- /dev/null +++ b/opentofu/modules/k8s_control_plane/outputs.tf @@ -0,0 +1,3 @@ +output "vm" { + value = proxmox_vm_qemu.k8s_cp +} diff --git a/opentofu/modules/k8s_control_plane/variables.tf b/opentofu/modules/k8s_control_plane/variables.tf new file mode 100644 index 0000000..e359f77 --- /dev/null +++ b/opentofu/modules/k8s_control_plane/variables.tf @@ -0,0 +1,25 @@ +variable "name" {} +variable "desc" {} +variable "agent" {} +variable "target_node" {} +variable "tags" {} +variable "clone" {} +variable "full_clone" {} +variable "qemu_os" {} +variable "cores" {} +variable "sockets" {} +variable "cpu_type" {} +variable "memory" {} +variable "scsihw" {} +variable "bootdisk" {} +variable "cloudinit_storage" {} +variable "disk_storage" {} +variable "disk_size" {} +variable "iothread" {} +variable "replicate" {} +variable "network_id" {} +variable "network_model" {} +variable "network_bridge" {} +variable "ipconfig0" {} +variable "ciuser" {} +variable "sshkeys" {} diff --git a/opentofu/modules/k8s_control_plane/versions.tf b/opentofu/modules/k8s_control_plane/versions.tf new file mode 100644 index 0000000..07c0f16 --- /dev/null +++ b/opentofu/modules/k8s_control_plane/versions.tf @@ -0,0 +1,11 @@ +terraform { + required_version = ">= 1.8.0" + + required_providers { + proxmox = { + source = "telmate/proxmox" + version = "3.0.1-rc6" + } + } +} + |