This commit is contained in:
2025-02-24 06:21:11 -06:00
parent b549c9cfb2
commit 3c8bd3ffd0
3 changed files with 16 additions and 47 deletions

View File

@@ -8,7 +8,7 @@ variables:
GITLAB_TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/dmz
image:
name: registry.internal.durp.info/opentofu/opentofu:latest
name: registry.durp.info/opentofu/opentofu:latest
entrypoint: [""]
.tf-init:
@@ -45,7 +45,7 @@ validate:
- changes:
- "dmz/terraform/*.tf"
plan-dmzstructure:
plan-dmz-infrastructure:
stage: plan
variables:
PLAN: plan.tfplan
@@ -66,7 +66,7 @@ plan-dmzstructure:
- changes:
- "dmz/terraform/*.tf"
apply-dmzstructure:
apply-dmz-infrastructure:
stage: apply
variables:
ENVIRONMENT_NAME: dmz
@@ -78,9 +78,9 @@ apply-dmzstructure:
- changes:
- "dmz/terraform/*.tf"
when: manual
needs: ["plan-dmzstructure"]
needs: ["plan-dmz-infrastructure"]
destroy-dmzstructure:
destroy-dmz-infrastructure:
stage: destroy
variables:
ENVIRONMENT_NAME: dmz
@@ -92,4 +92,4 @@ destroy-dmzstructure:
- changes:
- "dmz/terraform/*.tf"
when: manual
needs: ["plan-dmzstructure"]
needs: ["plan-dmz-infrastructure"]

View File

@@ -1,14 +1,13 @@
resource "proxmox_vm_qemu" "k3smaster" {
lifecycle {
prevent_destroy = true
}
count = local.k3smaster.count
ciuser = "administrator"
vmid = "${local.vlan}${local.k3smaster.ip[count.index]}"
name = local.k3smaster.name[count.index]
target_node = local.k3smaster.node[count.index]
clone = local.template
tags = local.k3smaster.tags
full_clone = false
qemu_os = "l26"
full_clone = true
os_type = "cloud-init"
agent = 1
cores = local.k3smaster.cores
@@ -16,9 +15,10 @@ resource "proxmox_vm_qemu" "k3smaster" {
cpu_type = "host"
memory = local.k3smaster.memory
scsihw = "virtio-scsi-pci"
boot = "order=virtio0"
onboot = true
sshkeys = local.sshkeys
#bootdisk = "scsi0"
boot = "order=virtio0"
onboot = true
sshkeys = local.sshkeys
vga {
type = "serial0"
}
@@ -57,16 +57,15 @@ resource "proxmox_vm_qemu" "k3smaster" {
}
resource "proxmox_vm_qemu" "k3sserver" {
lifecycle {
prevent_destroy = true
}
count = local.k3sserver.count
ciuser = "administrator"
vmid = "${local.vlan}${local.k3sserver.ip[count.index]}"
name = local.k3sserver.name[count.index]
target_node = local.k3sserver.node[count.index]
clone = local.template
tags = local.k3sserver.tags
qemu_os = "l26"
full_clone = false
full_clone = true
os_type = "cloud-init"
agent = 1
cores = local.k3sserver.cores

View File

@@ -45,34 +45,4 @@ locals {
node = ["mothership", "overlord", "vanguard"]
ip = ["21", "22", "23"]
}
haproxy = {
tags = "haproxy"
count = 3
name = ["haproxy-01", "haproxy-02", "haproxy-03"]
cores = 2
memory = "1024"
drive = 20
node = ["mothership", "overlord", "vanguard"]
ip = ["31", "32", "33"]
}
postgres = {
tags = "postgres"
count = 3
name = ["postgres-01", "postgres-02", "postgres-03"]
cores = 4
memory = "4096"
drive = 40
node = ["mothership", "overlord", "vanguard"]
ip = ["34", "35", "36"]
}
pihole = {
tags = "pihole"
count = 3
name = ["pihole-01", "pihole-02", "pihole-03"]
cores = 2
memory = "2048"
drive = 20
node = ["mothership", "overlord", "vanguard"]
ip = ["41", "42", "43"]
}
}