From 56d2e903739cd09438d86f3a2157fe43f0653efc Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Mon, 24 Jun 2024 15:33:09 -0400 Subject: [PATCH] updating --- adguard.tf | 1 + arm.tf | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ arrbuntu.tf | 1 + downloaders.tf | 1 + k3s-master.tf | 1 + k3s-master2.tf | 1 + k3s-master3.tf | 1 + nexus.tf | 1 + npm.tf | 1 + provider.tf | 46 +++------------------------------- runner.tf | 1 + vars.tf | 39 +++++++++++++++++++++++++++++ whisper.tf | 2 ++ 13 files changed, 122 insertions(+), 42 deletions(-) create mode 100644 arm.tf create mode 100644 vars.tf diff --git a/adguard.tf b/adguard.tf index f852118..c837599 100644 --- a/adguard.tf +++ b/adguard.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Adguard" { cpu { cores = 2 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/arm.tf b/arm.tf new file mode 100644 index 0000000..15f1a18 --- /dev/null +++ b/arm.tf @@ -0,0 +1,68 @@ +resource "proxmox_virtual_environment_vm" "ARM" { + + # VM General Settings + node_name = "prox" + vm_id = 8100 + name = "ARM" + description = "Ubuntu 24 ARM" + tags = ["tofu", "ubuntu-22", "auto-homelab-repo", "infrastructure"] + bios = "ovmf" + started = false + + agent { + enabled = false # read 'Qemu guest agent' section, change to true only when ready + } + + # VM Memory Settings + memory { + dedicated = 2048 + } + + # VM Network Settings + network_device { + bridge = "vmbr0" + vlan_id = 1 + } + + # VM Disk Settings + disk { + datastore_id = "Fast2Tb" + file_id = proxmox_virtual_environment_download_file.latest_ubuntu_22_arm_jammy_qcow2_img.id + size = 100 + interface = "scsi0" + } + + efi_disk { + type = "4m" + } + + vga { + type = "serial0" + } + + initialization { + ip_config { + ipv4 { + address = "dhcp" + } + } + + user_account {} + } + + lifecycle { + ignore_changes = [ + initialization[0].user_account[0].keys, + initialization[0].user_account[0].password, + initialization[0].user_account[0].username, + ] + } + +} + +resource "proxmox_virtual_environment_download_file" "latest_ubuntu_22_arm_jammy_qcow2_img" { + content_type = "iso" + datastore_id = "local" + node_name = "prox" + url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img" + } \ No newline at end of file diff --git a/arrbuntu.tf b/arrbuntu.tf index 1d20ae8..4648116 100644 --- a/arrbuntu.tf +++ b/arrbuntu.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Arrbuntu" { cpu { cores = 2 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/downloaders.tf b/downloaders.tf index eb2f288..8d6b028 100644 --- a/downloaders.tf +++ b/downloaders.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Downloaders" { cpu { cores = 3 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/k3s-master.tf b/k3s-master.tf index 11965e8..4f25e07 100644 --- a/k3s-master.tf +++ b/k3s-master.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "K3s-Master" { cpu { cores = 4 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/k3s-master2.tf b/k3s-master2.tf index f108bb8..7b6b25c 100644 --- a/k3s-master2.tf +++ b/k3s-master2.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "K3s-Master2" { cpu { cores = 4 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/k3s-master3.tf b/k3s-master3.tf index 8e12152..cbf3ec7 100644 --- a/k3s-master3.tf +++ b/k3s-master3.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "K3s-Master3" { cpu { cores = 4 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/nexus.tf b/nexus.tf index 9e22696..79ccf75 100644 --- a/nexus.tf +++ b/nexus.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Nexus" { cpu { cores = 4 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/npm.tf b/npm.tf index 9a7c9b9..bc1a381 100644 --- a/npm.tf +++ b/npm.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "NPM" { cpu { cores = 2 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/provider.tf b/provider.tf index 50d7778..fa0ecb2 100644 --- a/provider.tf +++ b/provider.tf @@ -3,62 +3,24 @@ terraform { required_providers { proxmox = { source = "bpg/proxmox" - version = ">= 0.58.1" + version = ">= 0.60.0" } } } provider "proxmox" { endpoint = var.virtual_environment_endpoint - api_token = var.virtual_environment_api + password = var.ssh_password + username = "root@pam" insecure = true ssh { agent = true username = "root" + password = var.ssh_password node { name = "prox" address = var.prox_ip_address } } } - -variable "virtual_environment_endpoint" { - type = string -} - -variable "virtual_environment_api" { - type = string -} - -variable "arrbuntu_ip_address" { - type = string -} - - variable "vlan_gateway" { - type = string -} - -variable "downloaders_ip_address" { - type = string -} - -variable "whisper_ip_address" { - type = string -} - -variable "ssh_password" { - type = string -} - -variable "ssh_username" { - type = string -} - -variable "prox_ip_address" { - type = string -} - -variable "npm_ip_address" { - type = string -} \ No newline at end of file diff --git a/runner.tf b/runner.tf index 16d0843..1bee987 100644 --- a/runner.tf +++ b/runner.tf @@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Runner" { cpu { cores = 2 type = "host" + architecture = "x86_64" } # VM Memory Settings diff --git a/vars.tf b/vars.tf new file mode 100644 index 0000000..f81f305 --- /dev/null +++ b/vars.tf @@ -0,0 +1,39 @@ +variable "virtual_environment_endpoint" { + type = string +} + +variable "virtual_environment_api" { + type = string +} + +variable "arrbuntu_ip_address" { + type = string +} + + variable "vlan_gateway" { + type = string +} + +variable "downloaders_ip_address" { + type = string +} + +variable "whisper_ip_address" { + type = string +} + +variable "ssh_password" { + type = string +} + +variable "ssh_username" { + type = string +} + +variable "prox_ip_address" { + type = string +} + +variable "npm_ip_address" { + type = string +} \ No newline at end of file diff --git a/whisper.tf b/whisper.tf index 5ca149c..ff5a4de 100644 --- a/whisper.tf +++ b/whisper.tf @@ -7,6 +7,7 @@ resource "proxmox_virtual_environment_vm" "Whisper" { machine = "q35" description = "Creates subtitles for Bazarr and stable-diffusion" tags = ["tofu", "ubuntu-22", "auto-homelab-repo"] + started = false agent { enabled = true # read 'Qemu guest agent' section, change to true only when ready @@ -20,6 +21,7 @@ resource "proxmox_virtual_environment_vm" "Whisper" { cpu { cores = 2 type = "host" + architecture = "x86_64" } # VM Memory Settings