Compare commits

..

18 Commits

Author SHA1 Message Date
79b535bb59 fix: code quality improvements
Some checks failed
Gitea Actions Demo / Terraform Plan (push) Failing after 15s
- Remove duplicate variables (alpaca_count, llama_count)
- Remove unused variables (vm_name, disk_type)
- Fix outputs to use correct variable names
- Fix cloud-init template to not overwrite source file
- Fix hardcoded hostname in cloud-init template
- Fix typo in SSH_KEY_PUBLIC description
2026-02-27 01:25:25 +00:00
84e45b4c61 Merge pull request 'stage' (#18) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 3m58s
Reviewed-on: #18
2025-04-18 11:14:21 +00:00
bada1b69da Merge pull request 'stage' (#17) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 4m58s
Reviewed-on: #17
2025-04-18 10:43:01 +00:00
8d9eea6728 Merge pull request 'terraform fmt' (#16) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 1m42s
Reviewed-on: #16
2025-04-17 21:54:27 +00:00
8d49e447e6 Merge pull request 'terraform fmt' (#15) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 1m39s
Reviewed-on: #15
2025-04-17 21:40:34 +00:00
d634e124a3 Merge pull request 'stage' (#14) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 1m11s
Reviewed-on: #14
2025-04-17 21:29:51 +00:00
70139b2693 Merge pull request 'terraform fmt' (#13) from stage into master
Some checks failed
Gitea Actions Demo / Terraform Apply (push) Failing after 30s
Reviewed-on: #13
2025-04-17 21:18:18 +00:00
1b6eca0f69 Merge pull request 'stage' (#12) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 4m29s
Reviewed-on: #12
2025-04-17 21:00:27 +00:00
3e55a72767 Merge pull request 'stage' (#11) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 5m57s
Reviewed-on: #11
2025-04-17 20:27:27 +00:00
b26ff582a4 Merge pull request 'terraform fmt' (#10) from stage into master
Some checks failed
Gitea Actions Demo / Terraform Apply (push) Failing after 5m42s
Reviewed-on: #10
2025-04-17 18:24:08 +00:00
114bfb9772 Merge pull request 'stage' (#8) from stage into master
Some checks failed
Gitea Actions Demo / Terraform Apply (push) Failing after 5m24s
Reviewed-on: #8
2025-04-17 16:12:34 +00:00
5509e14066 Merge pull request 'stage' (#7) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 4m26s
Reviewed-on: #7
2025-04-17 15:15:02 +00:00
df088a7903 Merge pull request 'terraform apply' (#6) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 4m38s
Reviewed-on: #6
2025-04-17 14:06:19 +00:00
dcec6c3648 Merge pull request 'stage' (#5) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 4m24s
Reviewed-on: #5
2025-04-17 12:46:36 +00:00
a0ee1b8a4b Merge pull request 'terraform apply' (#4) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 1m51s
Reviewed-on: #4
2025-04-17 12:19:34 +00:00
39d4e2ac65 Merge pull request 'terraform apply' (#3) from stage into master
All checks were successful
Gitea Actions Demo / Terraform Apply (push) Successful in 4m52s
Reviewed-on: #3
2025-04-17 10:22:41 +00:00
6d06cfac02 Merge pull request 'terraform apply' (#2) from stage into master
Some checks failed
Gitea Actions Demo / Terraform Apply (push) Failing after 2m55s
Reviewed-on: #2
2025-04-17 10:11:32 +00:00
e669353638 Merge pull request 'terraform apply' (#1) from stage into master
Some checks failed
Gitea Actions Demo / Terraform Plan (push) Successful in 37s
Gitea Actions Demo / Terraform Apply (push) Has been cancelled
Reviewed-on: #1
2025-04-17 10:04:50 +00:00
5 changed files with 7 additions and 33 deletions

View File

@@ -1,7 +1,5 @@
### Global cloud-init template (for all VMs)
data "template_file" "cloud_init_global" { data "template_file" "cloud_init_global" {
template = file("${path.module}/files/cloud_init_global.yaml") template = file("${path.module}/files/cloud_init_global.tpl")
vars = { vars = {
hostname = "generic" hostname = "generic"
@@ -13,5 +11,5 @@ data "template_file" "cloud_init_global" {
resource "local_file" "cloud_init_global" { resource "local_file" "cloud_init_global" {
content = data.template_file.cloud_init_global.rendered content = data.template_file.cloud_init_global.rendered
filename = "${path.module}/files/cloud_init_global.yaml" filename = "${path.module}/files/rendered/cloud_init_global.yaml"
} }

View File

@@ -1,6 +1,5 @@
#cloud-config #cloud-config
#cloud-config hostname: ${hostname}
hostname: myvm
manage_etc_hosts: true manage_etc_hosts: true
resolv_conf: resolv_conf:
nameservers: nameservers:

View File

@@ -1,6 +1,6 @@
output "alpaca_vm_ids" { output "alpaca_vm_ids" {
value = { value = {
for i in range(var.alpaca_count) : for i in range(var.alpaca_vm_count) :
"alpaca-${i + 1}" => proxmox_vm_qemu.alpacas[i].vmid "alpaca-${i + 1}" => proxmox_vm_qemu.alpacas[i].vmid
} }
} }
@@ -11,7 +11,7 @@ output "alpaca_vm_names" {
output "llama_vm_ids" { output "llama_vm_ids" {
value = { value = {
for i in range(var.llama_count) : for i in range(var.llama_vm_count) :
"llama-${i + 1}" => proxmox_vm_qemu.llamas[i].vmid "llama-${i + 1}" => proxmox_vm_qemu.llamas[i].vmid
} }
} }
@@ -19,4 +19,3 @@ output "llama_vm_ids" {
output "llama_vm_names" { output "llama_vm_names" {
value = [for vm in proxmox_vm_qemu.llamas : vm.name] value = [for vm in proxmox_vm_qemu.llamas : vm.name]
} }

View File

@@ -1,12 +1,10 @@
target_node = "flex" target_node = "flex"
clone_template = "ubuntu-cloudinit" clone_template = "ubuntu-cloudinit"
vm_name = "alpine-vm"
cores = 1 cores = 1
memory = 1024 memory = 1024
disk_size = "15G" disk_size = "15G"
sockets = 1 sockets = 1
bridge = "vmbr0" bridge = "vmbr0"
disk_type = "scsi"
storage = "Flash" storage = "Flash"
pm_api_url = "https://100.105.0.115:8006/api2/json" pm_api_url = "https://100.105.0.115:8006/api2/json"
pm_user = "terraform-prov@pve" pm_user = "terraform-prov@pve"

View File

@@ -10,10 +10,6 @@ variable "clone_template" {
type = string type = string
} }
variable "vm_name" {
type = string
}
variable "cores" { variable "cores" {
type = number type = number
} }
@@ -34,10 +30,6 @@ variable "bridge" {
type = string type = string
} }
variable "disk_type" {
type = string
}
variable "storage" { variable "storage" {
type = string type = string
} }
@@ -50,18 +42,6 @@ variable "pm_user" {
type = string type = string
} }
variable "alpaca_count" {
type = number
default = 1
description = "How many Alpaca VMs to create"
}
variable "llama_count" {
type = number
default = 1
description = "How many Llama VMs to create"
}
variable "alpaca_vm_count" { variable "alpaca_vm_count" {
type = number type = number
default = 1 default = 1
@@ -81,5 +61,5 @@ variable "TS_AUTHKEY" {
variable "SSH_KEY_PUBLIC" { variable "SSH_KEY_PUBLIC" {
type = string type = string
description = "My Public SSH key fo ssh auth list" description = "My Public SSH key for ssh auth list"
} }