This commit is contained in:
Matt Reeves 2024-06-24 15:33:09 -04:00
parent 98fe007436
commit 56d2e90373
13 changed files with 122 additions and 42 deletions

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Adguard" {
cpu { cpu {
cores = 2 cores = 2
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

68
arm.tf Normal file
View file

@ -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"
}

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Arrbuntu" {
cpu { cpu {
cores = 2 cores = 2
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Downloaders" {
cpu { cpu {
cores = 3 cores = 3
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "K3s-Master" {
cpu { cpu {
cores = 4 cores = 4
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "K3s-Master2" {
cpu { cpu {
cores = 4 cores = 4
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "K3s-Master3" {
cpu { cpu {
cores = 4 cores = 4
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Nexus" {
cpu { cpu {
cores = 4 cores = 4
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

1
npm.tf
View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "NPM" {
cpu { cpu {
cores = 2 cores = 2
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

View file

@ -3,62 +3,24 @@ terraform {
required_providers { required_providers {
proxmox = { proxmox = {
source = "bpg/proxmox" source = "bpg/proxmox"
version = ">= 0.58.1" version = ">= 0.60.0"
} }
} }
} }
provider "proxmox" { provider "proxmox" {
endpoint = var.virtual_environment_endpoint endpoint = var.virtual_environment_endpoint
api_token = var.virtual_environment_api password = var.ssh_password
username = "root@pam"
insecure = true insecure = true
ssh { ssh {
agent = true agent = true
username = "root" username = "root"
password = var.ssh_password
node { node {
name = "prox" name = "prox"
address = var.prox_ip_address 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
}

View file

@ -19,6 +19,7 @@ resource "proxmox_virtual_environment_vm" "Runner" {
cpu { cpu {
cores = 2 cores = 2
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings

39
vars.tf Normal file
View file

@ -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
}

View file

@ -7,6 +7,7 @@ resource "proxmox_virtual_environment_vm" "Whisper" {
machine = "q35" machine = "q35"
description = "Creates subtitles for Bazarr and stable-diffusion" description = "Creates subtitles for Bazarr and stable-diffusion"
tags = ["tofu", "ubuntu-22", "auto-homelab-repo"] tags = ["tofu", "ubuntu-22", "auto-homelab-repo"]
started = false
agent { agent {
enabled = true # read 'Qemu guest agent' section, change to true only when ready enabled = true # read 'Qemu guest agent' section, change to true only when ready
@ -20,6 +21,7 @@ resource "proxmox_virtual_environment_vm" "Whisper" {
cpu { cpu {
cores = 2 cores = 2
type = "host" type = "host"
architecture = "x86_64"
} }
# VM Memory Settings # VM Memory Settings