Add LXC Template

This commit is contained in:
Shawn Borton 2026-09-18 17:28:54 -05:00
parent bb87fac412
commit 487355aab4

View file

@ -1,13 +1,13 @@
* Terraform Plan for Crows Nest ISO * Terraform Plan for Crows Nest ISO
** Prompt ** Prompt
Please create a Terraform plan that will allow me to provision a new virtual machine on Proxmox using the telmate Proxmox provider. This virtual machine should have 4 CPU cores, 8GB of RAM, and 64 GB of disk space. Please give it an ID of 105, set full_clone to be true, and set the node's name to roxie. Also, turn on automatic reboot of the virtual machine. Leave the following information blank so that I can fill it in later: the URL of the Proxmox instance, the user name, and the token from Proxmox. Call the VM "crows-nest" Please create a Terraform plan that will allow me to provision a new virtual machine on Proxmox using the telmate Proxmox provider. This virtual machine should have 4 CPU cores, 8GB of RAM, and 64 GB of disk space. Please give it an ID of 105, set full_clone to be true, and set the node's name to roxie. Also, turn on automatic reboot of the virtual machine. Leave the following information blank so that I can fill it in later: the URL of the Proxmox instance, the user name, and the token from Proxmox. Call the VM "crows-nest"
** Result (from Claude Sonnet 4) ** NixOS Virtual Machie Template (from Claude Sonnet 4)
#+begin_src terraform :tangle /home/shawnb/Development/terraform/nixos_template_provider.tf #+begin_src terraform :tangle /home/shawnb/Development/falcon_nest/terraform/nixos_template_provider.tf
terraform { terraform {
required_providers { required_providers {
proxmox = { proxmox = {
source = "telmate/proxmox" source = "telmate/proxmox"
version = "3.0.2-rc01" version = "3.0.2-rc10"
} }
} }
} }
@ -78,3 +78,40 @@ resource "proxmox_vm_qemu" "nixos-template" {
} }
#+end_src #+end_src
** NixOS LXC Template (from Telmate's Proxmox Terraform guide)
#+begin_src terraform :tangle /home/shawnb/Development/falcon_nest/terraform/nixos_lxc_template.tf
resource "proxmox_lxc" "nixos-lxc-templ" {
target_node = "roxie"
hostname = "nixos-lxc-template"
ostemplate = "local:vztmpl/nixos-image-lxc-proxmox-26.11pre-git-x86_64-linux.tar.xz"
password = "XD8stvkUiF;"
description = "NixOS-based LXC"
unprivileged = true
full = true
cores = 1
memory = 2048
template = true
vmid = 901
ssh_public_keys = <<-EOT
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILgyiCfvu21kVTfRyKjzpH+93k7Jsf+EqLfN6NtolHnf tech@shilohsvillage.com
EOT
features {
nesting = true
}
// Terraform will crash without rootfs defined
rootfs {
storage = "local-lvm"
size = "40G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "dhcp"
}
}
#+end_src