aboutsummaryrefslogtreecommitdiff
path: root/opentofu/modules
diff options
context:
space:
mode:
authorclyhtsuriva <aimeric@adjutor.xyz>2025-02-18 21:03:00 +0100
committerclyhtsuriva <aimeric@adjutor.xyz>2025-02-18 21:03:00 +0100
commit1e1a8a1f3f4a8586072d3e31d2bef9c27786d448 (patch)
tree95b1618e62c971265f1df55131e1a784d2e3d873 /opentofu/modules
parent8af7efa1e03c1d37cf34197249e487348d382d82 (diff)
Replace proxmox provider telmate by bpg + remove k8s cluster (talos on the way)HEADmaster
Also changes the id of the packer images, now starting at the "end" (999), while VMs start at 100
Diffstat (limited to 'opentofu/modules')
-rw-r--r--opentofu/modules/ansible_provisioner/main.tf2
-rw-r--r--opentofu/modules/k8s_control_plane/main.tf55
-rw-r--r--opentofu/modules/k8s_control_plane/outputs.tf3
-rw-r--r--opentofu/modules/k8s_control_plane/variables.tf143
-rw-r--r--opentofu/modules/k8s_control_plane/versions.tf11
-rw-r--r--opentofu/modules/k8s_worker/main.tf56
-rw-r--r--opentofu/modules/k8s_worker/outputs.tf3
-rw-r--r--opentofu/modules/k8s_worker/variables.tf149
-rw-r--r--opentofu/modules/k8s_worker/versions.tf10
9 files changed, 1 insertions, 431 deletions
diff --git a/opentofu/modules/ansible_provisioner/main.tf b/opentofu/modules/ansible_provisioner/main.tf
index 0de288e..b836213 100644
--- a/opentofu/modules/ansible_provisioner/main.tf
+++ b/opentofu/modules/ansible_provisioner/main.tf
@@ -1,6 +1,6 @@
resource "null_resource" "ansible_provisioner" {
triggers = {
- ip_or_inventory = coalesce(var.vm_ip, var.inventory_file_path) # Choose based on what is provided
+ ip_or_inventory = coalesce(var.vm_ip, var.inventory_file_path) # Choose based on what is provided
}
provisioner "local-exec" {
diff --git a/opentofu/modules/k8s_control_plane/main.tf b/opentofu/modules/k8s_control_plane/main.tf
deleted file mode 100644
index d8477af..0000000
--- a/opentofu/modules/k8s_control_plane/main.tf
+++ /dev/null
@@ -1,55 +0,0 @@
-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
deleted file mode 100644
index a081907..0000000
--- a/opentofu/modules/k8s_control_plane/outputs.tf
+++ /dev/null
@@ -1,3 +0,0 @@
-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
deleted file mode 100644
index 4ffb3bd..0000000
--- a/opentofu/modules/k8s_control_plane/variables.tf
+++ /dev/null
@@ -1,143 +0,0 @@
-variable "name" {
- type = string
- description = "The name of the virtual machine."
-}
-
-variable "desc" {
- type = string
- description = "A description of the virtual machine."
- default = ""
-}
-
-variable "agent" {
- type = number
- description = "Whether to enable the QEMU guest agent (0 = disabled, 1 = enabled)."
- default = 0
-}
-
-variable "target_node" {
- type = string
- description = "The name of the Proxmox node where the VM will be created."
-}
-
-variable "tags" {
- type = string
- description = "Tags to assign to the virtual machine."
- default = ""
-}
-
-variable "clone" {
- type = string
- description = "The name of the VM template to clone."
-}
-
-variable "full_clone" {
- type = bool
- description = "Whether to create a full clone of the template (true) or a linked clone (false)."
- default = true
-}
-
-variable "qemu_os" {
- type = string
- description = "The type of OS installed on the VM."
- default = "l26" # Default is Linux 2.6/3.x/4.x/5.x kernel
-}
-
-variable "cores" {
- type = number
- description = "The number of CPU cores to allocate to the VM."
- default = 1
-}
-
-variable "sockets" {
- type = number
- description = "The number of CPU sockets to allocate to the VM."
- default = 1
-}
-
-variable "cpu_type" {
- type = string
- description = "The type of CPU to emulate (e.g., 'host', 'kvm64')."
- default = "host"
-}
-
-variable "memory" {
- type = number
- description = "The amount of memory (in MB) to allocate to the VM."
- default = 1024
-}
-
-variable "scsihw" {
- type = string
- description = "The SCSI controller type (e.g., 'virtio-scsi-pci', 'virtio-scsi-single')."
- default = "virtio-scsi-pci"
-}
-
-variable "bootdisk" {
- type = string
- description = "The boot disk interface (e.g., 'scsi0', 'virtio0')."
- default = "virtio0"
-}
-
-variable "cloudinit_storage" {
- type = string
- description = "The storage pool for the cloud-init drive."
-}
-
-variable "disk_storage" {
- type = string
- description = "The storage pool for the primary disk."
-}
-
-variable "disk_size" {
- type = string
- description = "The size of the primary disk (e.g., '20G')."
-}
-
-variable "iothread" {
- type = bool
- description = "Whether to enable IO threading for the disk."
- default = false
-}
-
-variable "replicate" {
- type = bool
- description = "Whether to replicate the disk to other nodes."
- default = false
-}
-
-variable "network_id" {
- type = number
- description = "The ID of the network interface."
- default = 0
-}
-
-variable "network_model" {
- type = string
- description = "The model of the network interface (e.g., 'virtio')."
- default = "virtio"
-}
-
-variable "network_bridge" {
- type = string
- description = "The bridge to attach the network interface to."
- default = "vmbr0"
-}
-
-variable "ipconfig0" {
- type = string
- description = "The IP configuration for the VM (e.g., 'ip=dhcp')."
- default = "ip=dhcp"
-}
-
-variable "ciuser" {
- type = string
- description = "The username for cloud-init."
- default = ""
-}
-
-variable "sshkeys" {
- type = string
- description = "The SSH public keys to inject into the VM via cloud-init."
- default = ""
-}
diff --git a/opentofu/modules/k8s_control_plane/versions.tf b/opentofu/modules/k8s_control_plane/versions.tf
deleted file mode 100644
index 07c0f16..0000000
--- a/opentofu/modules/k8s_control_plane/versions.tf
+++ /dev/null
@@ -1,11 +0,0 @@
-terraform {
- required_version = ">= 1.8.0"
-
- required_providers {
- proxmox = {
- source = "telmate/proxmox"
- version = "3.0.1-rc6"
- }
- }
-}
-
diff --git a/opentofu/modules/k8s_worker/main.tf b/opentofu/modules/k8s_worker/main.tf
deleted file mode 100644
index ff039b2..0000000
--- a/opentofu/modules/k8s_worker/main.tf
+++ /dev/null
@@ -1,56 +0,0 @@
-resource "proxmox_vm_qemu" "k8s_worker" {
- lifecycle {
- ignore_changes = [
- bootdisk,
- ]
- }
-
- count = var.vm_count
- name = "${var.name_prefix}-${count.index}"
- 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_worker/outputs.tf b/opentofu/modules/k8s_worker/outputs.tf
deleted file mode 100644
index c72c51e..0000000
--- a/opentofu/modules/k8s_worker/outputs.tf
+++ /dev/null
@@ -1,3 +0,0 @@
-output "vms" {
- value = proxmox_vm_qemu.k8s_worker
-}
diff --git a/opentofu/modules/k8s_worker/variables.tf b/opentofu/modules/k8s_worker/variables.tf
deleted file mode 100644
index e11a5a2..0000000
--- a/opentofu/modules/k8s_worker/variables.tf
+++ /dev/null
@@ -1,149 +0,0 @@
-variable "vm_count" {
- type = number
- description = "The number of virtual machines to create."
- default = 1
-}
-
-variable "name_prefix" {
- type = string
- description = "The prefix for the names of the virtual machines. The VM names will be in the format '<name_prefix>-<index>'."
-}
-
-variable "desc" {
- type = string
- description = "A description of the virtual machines."
- default = ""
-}
-
-variable "agent" {
- type = number
- description = "Whether to enable the QEMU guest agent (0 = disabled, 1 = enabled)."
- default = 0
-}
-
-variable "target_node" {
- type = string
- description = "The name of the Proxmox node where the VMs will be created."
-}
-
-variable "tags" {
- type = string
- description = "Tags to assign to the virtual machines."
- default = ""
-}
-
-variable "clone" {
- type = string
- description = "The name of the VM template to clone."
-}
-
-variable "full_clone" {
- type = bool
- description = "Whether to create a full clone of the template (true) or a linked clone (false)."
- default = true
-}
-
-variable "qemu_os" {
- type = string
- description = "The type of OS installed on the VMs."
- default = "l26" # Default is Linux 2.6/3.x/4.x/5.x kernel
-}
-
-variable "cores" {
- type = number
- description = "The number of CPU cores to allocate to each VM."
- default = 1
-}
-
-variable "sockets" {
- type = number
- description = "The number of CPU sockets to allocate to each VM."
- default = 1
-}
-
-variable "cpu_type" {
- type = string
- description = "The type of CPU to emulate (e.g., 'host', 'kvm64')."
- default = "host"
-}
-
-variable "memory" {
- type = number
- description = "The amount of memory (in MB) to allocate to each VM."
- default = 1024
-}
-
-variable "scsihw" {
- type = string
- description = "The SCSI controller type (e.g., 'virtio-scsi-pci', 'virtio-scsi-pci')."
- default = "virtio-scsi-pci"
-}
-
-variable "bootdisk" {
- type = string
- description = "The boot disk interface (e.g., 'scsi0', 'virtio0')."
- default = "virtio0"
-}
-
-variable "cloudinit_storage" {
- type = string
- description = "The storage pool for the cloud-init drive."
-}
-
-variable "disk_storage" {
- type = string
- description = "The storage pool for the primary disk."
-}
-
-variable "disk_size" {
- type = string
- description = "The size of the primary disk (e.g., '20G')."
-}
-
-variable "iothread" {
- type = bool
- description = "Whether to enable IO threading for the disk."
- default = false
-}
-
-variable "replicate" {
- type = bool
- description = "Whether to replicate the disk to other nodes."
- default = false
-}
-
-variable "network_id" {
- type = number
- description = "The ID of the network interface."
- default = 0
-}
-
-variable "network_model" {
- type = string
- description = "The model of the network interface (e.g., 'virtio')."
- default = "virtio"
-}
-
-variable "network_bridge" {
- type = string
- description = "The bridge to attach the network interface to."
- default = "vmbr0"
-}
-
-variable "ipconfig0" {
- type = string
- description = "The IP configuration for the VMs (e.g., 'ip=dhcp')."
- default = "ip=dhcp"
-}
-
-variable "ciuser" {
- type = string
- description = "The username for cloud-init."
- default = ""
-}
-
-variable "sshkeys" {
- type = string
- description = "The SSH public keys to inject into the VMs via cloud-init."
- default = ""
-}
diff --git a/opentofu/modules/k8s_worker/versions.tf b/opentofu/modules/k8s_worker/versions.tf
deleted file mode 100644
index d9656aa..0000000
--- a/opentofu/modules/k8s_worker/versions.tf
+++ /dev/null
@@ -1,10 +0,0 @@
-terraform {
- required_version = ">= 1.8.0"
-
- required_providers {
- proxmox = {
- source = "telmate/proxmox"
- version = "3.0.1-rc6"
- }
- }
-}