From 487355aab4efeb9959b468b943571ac54af0a1eb Mon Sep 17 00:00:00 2001 From: Shawn Borton Date: Fri, 18 Sep 2026 17:28:54 -0500 Subject: [PATCH 1/2] Add LXC Template --- literal/terraform.org | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/literal/terraform.org b/literal/terraform.org index 339fb64..304efbc 100644 --- a/literal/terraform.org +++ b/literal/terraform.org @@ -1,13 +1,13 @@ * Terraform Plan for Crows Nest ISO ** 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" -** Result (from Claude Sonnet 4) -#+begin_src terraform :tangle /home/shawnb/Development/terraform/nixos_template_provider.tf +** NixOS Virtual Machie Template (from Claude Sonnet 4) +#+begin_src terraform :tangle /home/shawnb/Development/falcon_nest/terraform/nixos_template_provider.tf terraform { required_providers { 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 +** 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 + From 9ddfbe18f940715a16de164845c502923b375648 Mon Sep 17 00:00:00 2001 From: Shawn Borton Date: Fri, 18 Sep 2026 17:29:32 -0500 Subject: [PATCH 2/2] New version of Terraform provider --- terraform/provider.tf | 8 +-- terraform/terraform.tfstate | 117 +++++++++++++++++++++++++++++++++++- 2 files changed, 120 insertions(+), 5 deletions(-) diff --git a/terraform/provider.tf b/terraform/provider.tf index 3a57e36..804b877 100644 --- a/terraform/provider.tf +++ b/terraform/provider.tf @@ -1,14 +1,14 @@ terraform { required_providers { proxmox = { - source = "telmate/proxmox" - version = "3.0.2-rc01" + source = "telmate/proxmox" + version = "3.0.2-rc10" } } } provider "proxmox" { - pm_api_url = "https://pve.home.onionpatch.cloud:8006/api2/json" - pm_user = "terraform-prov@pve" + pm_api_url = "https://pve.home.onionpatch.cloud:8006/api2/json" + pm_user = "terraform-prov@pve" pm_password = "8pKkz^@C%gOYbegcGQ" } diff --git a/terraform/terraform.tfstate b/terraform/terraform.tfstate index 9f4d865..010d485 100644 --- a/terraform/terraform.tfstate +++ b/terraform/terraform.tfstate @@ -1 +1,116 @@ -{"version":4,"terraform_version":"1.10.3","serial":5,"lineage":"0954cb2d-ea1f-6ef0-fe21-5f795adcbfb1","outputs":{},"resources":[{"mode":"managed","type":"proxmox_vm_qemu","name":"crows-nest","provider":"provider[\"registry.opentofu.org/telmate/proxmox\"]","instances":[{"schema_version":0,"attributes":{"additional_wait":5,"agent":1,"agent_timeout":90,"args":"","automatic_reboot":true,"balloon":8192,"bios":"seabios","boot":"order=scsi0;ide2;net0","bootdisk":"","ci_wait":null,"cicustom":null,"cipassword":"","ciupgrade":false,"ciuser":"","clone":null,"clone_id":null,"clone_wait":10,"cores":0,"cpu":[{"affinity":"","cores":4,"flags":[],"limit":0,"numa":false,"sockets":1,"type":"host","units":0,"vcores":0}],"cpu_type":"","current_node":"roxie","default_ipv4_address":"","default_ipv6_address":null,"define_connection_info":true,"desc":"Automation platform with Portainer, Gitlab, and Ansible","disk":[],"disks":[{"ide":[{"ide0":[],"ide1":[],"ide2":[{"cdrom":[{"iso":"local:iso/nixos-25.05.20250816-x86_64-linux.iso","passthrough":false}],"cloudinit":[],"disk":[],"ignore":false,"passthrough":[]}],"ide3":[]}],"sata":[],"scsi":[{"scsi0":[{"cdrom":[],"cloudinit":[],"disk":[{"asyncio":"","backup":true,"cache":"","discard":false,"emulatessd":false,"format":"raw","id":0,"iops_r_burst":0,"iops_r_burst_length":0,"iops_r_concurrent":0,"iops_wr_burst":0,"iops_wr_burst_length":0,"iops_wr_concurrent":0,"iothread":true,"linked_disk_id":-1,"mbps_r_burst":0,"mbps_r_concurrent":0,"mbps_wr_burst":0,"mbps_wr_concurrent":0,"readonly":false,"replicate":false,"serial":"","size":"96G","storage":"local-lvm","wwn":""}],"ignore":false,"passthrough":[]}],"scsi1":[],"scsi10":[],"scsi11":[],"scsi12":[],"scsi13":[],"scsi14":[],"scsi15":[],"scsi16":[],"scsi17":[],"scsi18":[],"scsi19":[],"scsi2":[],"scsi20":[],"scsi21":[],"scsi22":[],"scsi23":[],"scsi24":[],"scsi25":[],"scsi26":[],"scsi27":[],"scsi28":[],"scsi29":[],"scsi3":[],"scsi30":[],"scsi4":[],"scsi5":[],"scsi6":[],"scsi7":[],"scsi8":[],"scsi9":[]}],"virtio":[]}],"efidisk":[],"force_create":false,"force_recreate_on_change_of":null,"full_clone":true,"hagroup":"","hastate":"","hostpci":[],"hotplug":"0","id":"roxie/qemu/105","ipconfig0":null,"ipconfig1":null,"ipconfig10":null,"ipconfig11":null,"ipconfig12":null,"ipconfig13":null,"ipconfig14":null,"ipconfig15":null,"ipconfig2":null,"ipconfig3":null,"ipconfig4":null,"ipconfig5":null,"ipconfig6":null,"ipconfig7":null,"ipconfig8":null,"ipconfig9":null,"kvm":true,"linked_vmid":0,"machine":"","memory":8192,"name":"crows-nest","nameserver":null,"network":[{"bridge":"vmbr0","firewall":false,"id":0,"link_down":false,"macaddr":"bc:24:11:bd:e1:7a","model":"virtio","mtu":0,"queues":0,"rate":0,"tag":0}],"numa":false,"onboot":true,"os_network_config":null,"os_type":null,"pci":[],"pcis":[],"pool":"","protection":false,"pxe":null,"qemu_os":"l26","reboot_required":false,"scsihw":"virtio-scsi-single","searchdomain":null,"serial":[],"skip_ipv4":false,"skip_ipv6":false,"smbios":[{"family":"","manufacturer":"","product":"","serial":"","sku":"","uuid":"37b73bc3-23be-4684-81aa-b59da37726a0","version":""}],"sockets":0,"ssh_forward_ip":null,"ssh_host":"","ssh_port":"","ssh_private_key":null,"ssh_user":null,"sshkeys":null,"startup":"","tablet":true,"tags":"linux;nixos;server","target_node":"roxie","target_nodes":null,"timeouts":null,"tpm_state":[],"unused_disk":[],"usb":[],"usbs":[],"vcpus":0,"vga":[],"vm_state":"stopped","vmid":105},"sensitive_attributes":[[{"type":"get_attr","value":"cipassword"}],[{"type":"get_attr","value":"ssh_private_key"}]],"private":"eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWZhdWx0IjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19"}]}],"check_results":null} +{ + "version": 4, + "terraform_version": "1.12.1", + "serial": 8, + "lineage": "0954cb2d-ea1f-6ef0-fe21-5f795adcbfb1", + "outputs": {}, + "resources": [ + { + "mode": "managed", + "type": "proxmox_lxc", + "name": "nixos-lxc-templ", + "provider": "provider[\"registry.opentofu.org/telmate/proxmox\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arch": "amd64", + "bwlimit": 0, + "clone": null, + "clone_storage": null, + "cmode": "tty", + "console": true, + "cores": 1, + "cpulimit": 0, + "cpuunits": 1024, + "current_node": "roxie", + "description": "NixOS-based LXC\n", + "features": [ + { + "fuse": false, + "keyctl": false, + "mknod": false, + "mount": "", + "nesting": true + } + ], + "force": false, + "full": true, + "hagroup": "", + "hastate": "", + "hookscript": "", + "hostname": "nixos-lxc-template", + "id": "roxie/lxc/901", + "ignore_unpack_errors": false, + "lock": "", + "memory": 2048, + "mountpoint": [], + "nameserver": "", + "network": [ + { + "bridge": "vmbr0", + "firewall": false, + "gw": "", + "gw6": "", + "hwaddr": "BC:24:11:F1:51:52", + "id": 0, + "ip": "dhcp", + "ip6": "", + "mtu": 0, + "name": "eth0", + "rate": 0, + "tag": 0, + "trunks": "", + "type": "veth" + } + ], + "onboot": false, + "ostemplate": "local:vztmpl/nixos-image-lxc-proxmox-26.11pre-git-x86_64-linux.tar.xz", + "ostype": "nixos", + "password": "XD8stvkUiF;", + "pool": null, + "protection": false, + "restore": false, + "rootfs": [ + { + "acl": false, + "quota": false, + "replicate": false, + "ro": false, + "shared": false, + "size": "40G", + "storage": "local-lvm", + "volume": "local-lvm:vm-901-disk-0" + } + ], + "searchdomain": "", + "ssh_public_keys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILgyiCfvu21kVTfRyKjzpH+93k7Jsf+EqLfN6NtolHnf tech@shilohsvillage.com\n", + "start": false, + "startup": "", + "swap": 0, + "tags": "", + "target_node": "roxie", + "template": true, + "timeouts": null, + "tty": 2, + "unique": false, + "unprivileged": true, + "unused": [], + "vmid": 901 + }, + "sensitive_attributes": [ + [ + { + "type": "get_attr", + "value": "password" + } + ] + ], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWZhdWx0IjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19" + } + ] + } + ], + "check_results": null +} +