From 3c8bd3ffd07412ce7e35597ef54520cd9e194974 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Mon, 24 Feb 2025 06:21:11 -0600 Subject: [PATCH] update --- dmz/.gitlab/.gitlab-ci.yml | 12 ++++++------ dmz/terraform/k3s.tf | 21 ++++++++++----------- dmz/terraform/main.tf | 30 ------------------------------ 3 files changed, 16 insertions(+), 47 deletions(-) diff --git a/dmz/.gitlab/.gitlab-ci.yml b/dmz/.gitlab/.gitlab-ci.yml index 61ab572..e0532bc 100644 --- a/dmz/.gitlab/.gitlab-ci.yml +++ b/dmz/.gitlab/.gitlab-ci.yml @@ -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"] diff --git a/dmz/terraform/k3s.tf b/dmz/terraform/k3s.tf index 29426bd..bca2f62 100644 --- a/dmz/terraform/k3s.tf +++ b/dmz/terraform/k3s.tf @@ -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 diff --git a/dmz/terraform/main.tf b/dmz/terraform/main.tf index 97fe0b5..55a74b7 100644 --- a/dmz/terraform/main.tf +++ b/dmz/terraform/main.tf @@ -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"] - } }