From bab970fb467b37fd4d581e3ee7539038126eab07 Mon Sep 17 00:00:00 2001
From: GitHub Actions <actions@github.com>
Date: Wed, 8 Jan 2025 05:28:56 +0000
Subject: [PATCH] Add VM Plex configuration

---
 terraform/proxmox/Plex.tf | 51 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 terraform/proxmox/Plex.tf

diff --git a/terraform/proxmox/Plex.tf b/terraform/proxmox/Plex.tf
new file mode 100644
index 00000000..777e4e2d
--- /dev/null
+++ b/terraform/proxmox/Plex.tf
@@ -0,0 +1,51 @@
+resource "proxmox_virtual_environment_vm" "Plex" {
+    node_name    = "prox"
+    vm_id        = "202"
+    name         = "Plex"
+    description  = "Plex"
+
+    cpu {
+        cores = "4"
+        type  = "host"
+        architecture = "x86_64"
+    }
+
+    memory {
+        dedicated = "4096"
+    }
+
+    network_device {
+        bridge  = "vmbr0"
+        vlan_id = 1
+    }
+
+    disk {
+        datastore_id = "Fast2Tb"
+        size         = "30"
+        interface    = "scsi0"
+    }
+
+    clone {
+        vm_id = "9996"
+    }
+
+    initialization {
+        ip_config {
+            ipv4 {
+                address = "dhcp"
+                gateway = var.vlan_gateway
+            }
+        }
+
+        user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
+    }
+
+    lifecycle {
+    ignore_changes = [
+      initialization[0].user_account[0].keys,
+      initialization[0].user_account[0].password,
+      initialization[0].user_account[0].username,
+      initialization[0].user_data_file_id
+    ]
+  }
+}