Initial commit
This commit is contained in:
commit
a4db9c8516
36 changed files with 15659 additions and 0 deletions
24
terraform/.terraform.lock.hcl
generated
Normal file
24
terraform/.terraform.lock.hcl
generated
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# This file is maintained automatically by "tofu init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.opentofu.org/telmate/proxmox" {
|
||||
version = "3.0.2-rc01"
|
||||
constraints = "3.0.2-rc01"
|
||||
hashes = [
|
||||
"h1:571ROPuTMC0w5lr9hbUXi7NVLsG3SpmZxXXZx8cAT+Q=",
|
||||
"zh:34d264243a4513f4e30c01fb37cc6a3e592d7823dfd182c5edfb170ac7b7de3a",
|
||||
"zh:544428311ad20fbb3ad2cd854e893bbf036023cb57c3acc5093d141976dac670",
|
||||
"zh:5c2396b328edee8de7ac144c15a6b7e668e81063699bc8c110d7c39fb8da70e9",
|
||||
"zh:5ca8e33476ad06a0259071120a59477e8f107f30c1178ea7b9f6cafe1a461ade",
|
||||
"zh:5ea56eb8275edc754a01a0180750e9c939cd997d3a50659617770211f4337da9",
|
||||
"zh:9dd3482df6bbe00a4a6152be3567b6c08d35c3644a327a1f5ac30fd95ccd449f",
|
||||
"zh:a76075fafadcc94a825151aff169bae4e0c05e3c7717e16dcdcf16ffa61a0780",
|
||||
"zh:b1d95f97b22f671db762f7adf428b409e6736c078bcf267d8391985b8847d6e3",
|
||||
"zh:cc94255cd1b18e6a341c15089015c457c8c639c25c426b07f278d5ea9850b3b5",
|
||||
"zh:ce991103cb69b0b3e275127e3ab92c88bb3b6b0f4e5a2cb082aeaef70a7f7d61",
|
||||
"zh:d24838bce87b38e12544a1329f5ad30e2be045968e639a3f4ddd5c84aa648e04",
|
||||
"zh:e106ebd4eea8d62d62e62f261a262febc615e17466b54ac18f7e65c7e79e0008",
|
||||
"zh:e254ca76c95e6e92da973b7bddc36bfa0a1e31d7c7e758ef4b01315db969388b",
|
||||
"zh:f1d1d5f4c39267cacebe0ab7e9e06caf9692707f3b5369685541b65bc8b840ce",
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
[](https://travis-ci.com/Telmate/terraform-provider-proxmox)
|
||||
|
||||
# Terraform provider plugin for Proxmox
|
||||
|
||||
This repository provides a Terraform provider for
|
||||
the [Proxmox virtualization platform](https://pve.proxmox.com/pve-docs/) and exposes Terraform resources to provision
|
||||
QEMU VMs and LXC Containers.
|
||||
|
||||
## Getting Started
|
||||
|
||||
In order to get started, use [the documentation included in this repository](docs/index.md). The documentation contains
|
||||
a list of the options for the provider. Moreover, there are some guides available how to combine options and start
|
||||
specific VMs.
|
||||
|
||||
## Quick Start
|
||||
|
||||
Follow this [install guide](docs/guides/installation.md) to install the plugin.
|
||||
|
||||
## Known Limitations
|
||||
|
||||
* `proxmox_vm_qemu`.`disk`.`size` attribute does not match what is displayed in the Proxmox UI.
|
||||
* Updates to `proxmox_vm_qemu` resources almost always result as a failed task within the Proxmox UI. This appears to be
|
||||
harmless and the desired configuration changes do get applied.
|
||||
* When using the `proxmox_lxc` resource, the provider will crash unless `rootfs` is defined.
|
||||
* When using the Network Boot mode (PXE), a valid NIC must be defined for the VM, and the boot order must specify network first.
|
||||
|
||||
## Contributing
|
||||
|
||||
When contributing, please also add documentation to help other users.
|
||||
|
||||
### Debugging the provider
|
||||
|
||||
Debugging is available for this provider through the Terraform Plugin SDK versions 2.0.0. Therefore, the plugin can be
|
||||
started with the debugging flag `--debug`.
|
||||
|
||||
For example (using [delve](https://github.com/go-delve/delve) as Debugger):
|
||||
|
||||
```bash
|
||||
dlv exec --headless ./terraform-provider-my-provider -- --debug
|
||||
```
|
||||
|
||||
For more information about debugging a provider please
|
||||
see: [Debugger-Based Debugging](https://www.terraform.io/docs/extend/debugging.html#debugger-based-debugging)
|
||||
|
||||
## Useful links
|
||||
|
||||
* [Proxmox](https://www.proxmox.com/en/)
|
||||
* [Proxmox documentation](https://pve.proxmox.com/pve-docs/)
|
||||
* [Terraform](https://www.terraform.io/)
|
||||
* [Terraform documentation](https://www.terraform.io/docs/index.html)
|
||||
* [Recommended ISO builder](https://github.com/Telmate/terraform-ubuntu-proxmox-iso)
|
||||
Binary file not shown.
57
terraform/crows_nest.tf
Normal file
57
terraform/crows_nest.tf
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# General
|
||||
resource "proxmox_vm_qemu" "crows-nest" {
|
||||
name = "crows-nest"
|
||||
desc = "Automation platform with Portainer, Gitlab, and Ansible"
|
||||
agent = 1
|
||||
target_node = "roxie"
|
||||
vmid = 0
|
||||
vm_state = "stopped"
|
||||
onboot = true
|
||||
automatic_reboot = true
|
||||
|
||||
# Bios and OS
|
||||
bios = "seabios"
|
||||
qemu_os = "l26"
|
||||
tags = "nixos,server,linux"
|
||||
hotplug = 0
|
||||
|
||||
# CPU and Memory
|
||||
cpu {
|
||||
cores = 4
|
||||
sockets = 1
|
||||
type = "host"
|
||||
}
|
||||
memory = 8192
|
||||
balloon = 8192
|
||||
|
||||
# Disks
|
||||
scsihw = "virtio-scsi-single"
|
||||
|
||||
disks {
|
||||
ide {
|
||||
ide2 {
|
||||
cdrom {
|
||||
iso = "local:iso/nixos-25.05.20250816-x86_64-linux.iso"
|
||||
}
|
||||
}
|
||||
}
|
||||
scsi {
|
||||
scsi0 {
|
||||
disk {
|
||||
size = "96G"
|
||||
iothread = true
|
||||
replicate = false
|
||||
storage = "local-lvm"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Network
|
||||
network {
|
||||
id = 0
|
||||
model = "virtio"
|
||||
bridge = "vmbr0"
|
||||
}
|
||||
|
||||
}
|
||||
57
terraform/hermes_agent.tf
Normal file
57
terraform/hermes_agent.tf
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# General
|
||||
resource "proxmox_vm_qemu" "hermes-agent" {
|
||||
name = "hermes-agent"
|
||||
desc = "An agentic AI assistant for homelab maintenance and research assistance"
|
||||
agent = 1
|
||||
target_node = "roxie"
|
||||
vmid = 0
|
||||
vm_state = "stopped"
|
||||
onboot = true
|
||||
automatic_reboot = true
|
||||
|
||||
# Bios and OS
|
||||
bios = "seabios"
|
||||
qemu_os = "l26"
|
||||
tags = "nixos,server,linux"
|
||||
hotplug = 0
|
||||
|
||||
# CPU and Memory
|
||||
cpu {
|
||||
cores = 1
|
||||
sockets = 1
|
||||
type = "host"
|
||||
}
|
||||
memory = 2048
|
||||
balloon = 2048
|
||||
|
||||
# Disks
|
||||
scsihw = "virtio-scsi-single"
|
||||
|
||||
disks {
|
||||
ide {
|
||||
ide2 {
|
||||
cdrom {
|
||||
iso = "local:iso/nixos-25.05.20250816-x86_64-linux.iso"
|
||||
}
|
||||
}
|
||||
}
|
||||
scsi {
|
||||
scsi0 {
|
||||
disk {
|
||||
size = "40G"
|
||||
iothread = true
|
||||
replicate = false
|
||||
storage = "local-lvm"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Network
|
||||
network {
|
||||
id = 0
|
||||
model = "virtio"
|
||||
bridge = "vmbr0"
|
||||
}
|
||||
|
||||
}
|
||||
14
terraform/hermes_agent_provider.tf
Normal file
14
terraform/hermes_agent_provider.tf
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "telmate/proxmox"
|
||||
version = "3.0.2-rc01"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
pm_api_url = "https://pve.home.onionpatch.cloud:8006/api2/json"
|
||||
pm_user = "terraform-prov@pve"
|
||||
pm_password = "8pKkz^@C%gOYbegcGQ"
|
||||
}
|
||||
14
terraform/provider.tf
Normal file
14
terraform/provider.tf
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "telmate/proxmox"
|
||||
version = "3.0.2-rc01"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
pm_api_url = "https://pve.home.onionpatch.cloud:8006/api2/json"
|
||||
pm_user = "terraform-prov@pve"
|
||||
pm_password = "8pKkz^@C%gOYbegcGQ"
|
||||
}
|
||||
1
terraform/terraform.tfstate
Normal file
1
terraform/terraform.tfstate
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"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}
|
||||
1
terraform/terraform.tfstate.backup
Normal file
1
terraform/terraform.tfstate.backup
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":4,"terraform_version":"1.10.3","serial":4,"lineage":"0954cb2d-ea1f-6ef0-fe21-5f795adcbfb1","outputs":{},"resources":[],"check_results":null}
|
||||
Loading…
Add table
Add a link
Reference in a new issue