From 460b2f4c3602ee2cf7b1f775b9aafc885e71e619 Mon Sep 17 00:00:00 2001 From: Tim Unkrig Date: Fri, 27 Oct 2023 13:50:53 +0200 Subject: [PATCH 1/3] added services vm to repo --- infra.tf | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 infra.tf diff --git a/infra.tf b/infra.tf new file mode 100644 index 0000000..e5c58db --- /dev/null +++ b/infra.tf @@ -0,0 +1,96 @@ +# proxmox_virtual_environment_vm.devops: +resource "proxmox_virtual_environment_vm" "services" { + acpi = true + vm_id = "114" + machine = "q35" + name = "services" + node_name = "proxmox" + scsi_hardware = "virtio-scsi-pci" + started = true + tablet_device = false + tags = [] + template = false + + clone { + vm_id = 9999 + } + + agent { + enabled = true + timeout = "15m" + trim = false + type = "virtio" + } + + cpu { + cores = 2 + flags = [] + hotplugged = 0 + numa = false + sockets = 1 + type = "host" + units = 1024 + + } + + disk { + datastore_id = "local" + size = 30 + ssd = true + iothread = true + interface = "scsi0" + } + + initialization { + datastore_id = "local" + interface = "ide2" + + ip_config { + ipv4 { + address = "10.20.1.9/16" + gateway = "10.20.0.1" + } + ipv6 { + address = "auto" + } + } + + user_account { + keys = var.virtual_environment_sshkeys + username = "tim" + password = random_password.devops_vm_password.result + } + } + + memory { + dedicated = 4096 + floating = 0 + shared = 0 + } + + network_device { + bridge = "vmbr0" + enabled = true + firewall = false + model = "virtio" + mtu = 0 + rate_limit = 0 + vlan_id = 0 + } + + vga { + enabled = true + memory = 16 + type = "std" + } +} +resource "random_password" "services_vm_password" { + length = 16 + override_special = "_%@" + special = true +} + +output "services_vm_password" { + value = random_password.devops_vm_password.result + sensitive = true +} \ No newline at end of file -- 2.49.1 From ad6116e3a10ccbd6d2f0f8404323c690c8f9d18f Mon Sep 17 00:00:00 2001 From: Tim Unkrig Date: Fri, 27 Oct 2023 13:54:42 +0200 Subject: [PATCH 2/3] added services vm to repo --- infrastructure/infra.tf | 2 +- infra.tf => infrastructure/service.tf | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename infra.tf => infrastructure/service.tf (100%) diff --git a/infrastructure/infra.tf b/infrastructure/infra.tf index 6a737d7..f36a3f3 100644 --- a/infrastructure/infra.tf +++ b/infrastructure/infra.tf @@ -47,7 +47,7 @@ resource "proxmox_virtual_environment_vm" "infra" { ip_config { ipv4 { - address = "dhcp" + address = "auto" } ipv6 { address = "auto" diff --git a/infra.tf b/infrastructure/service.tf similarity index 100% rename from infra.tf rename to infrastructure/service.tf -- 2.49.1 From a4bd2e32668038a2be1e1cb30f40b2d7cf890332 Mon Sep 17 00:00:00 2001 From: Tim Unkrig Date: Fri, 27 Oct 2023 13:56:00 +0200 Subject: [PATCH 3/3] fixed syntax --- infrastructure/infra.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/infra.tf b/infrastructure/infra.tf index f36a3f3..6a737d7 100644 --- a/infrastructure/infra.tf +++ b/infrastructure/infra.tf @@ -47,7 +47,7 @@ resource "proxmox_virtual_environment_vm" "infra" { ip_config { ipv4 { - address = "auto" + address = "dhcp" } ipv6 { address = "auto" -- 2.49.1