This commit is contained in:
Mike McFetridge
2026-07-20 09:23:17 -04:00
parent c1315882da
commit 72272e4006
3179 changed files with 562960 additions and 14 deletions
+24
View File
@@ -0,0 +1,24 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/telmate/proxmox" {
version = "3.0.1-rc9"
constraints = "3.0.1-rc9"
hashes = [
"h1:TAkzCbpjazX/iNqkodNI63OvqtP6NsWI3CHcHdjieXY=",
"zh:037bae31005419d5ca6921940fc572d5acba264f5b80a09f9e8cf14edff9c189",
"zh:0decfc022e6e40f6e4d5dd60073b6d62dc7ec582e2e398fb4a0cbc88c61b9389",
"zh:16024c6ee5d0fa9c7041f8197e854f73026fd06e8b19ec61e40291ef50171d8a",
"zh:4839fa10755023b26305d519b6ad2a8d83b5f83d3a8f58bc9ac9a7e6ed20cb6a",
"zh:6b50a44d20b5bfa62580f7cd00c64a7b47f9b9d5dd32a7392ca218e33f9bda07",
"zh:83f67ac118e4e2c0ad4d93c50f3f05a262724b374c9ad34342826a384d1ce284",
"zh:84e51f6bbff5b4e016fdb0f2b594672917e053fbd7b99612cfef7eebf1ca6465",
"zh:9fd6fe66507e8ebd4b462f53c8f4e898d12a6b4e8f0d38ad24ea8d5b04b3d7a9",
"zh:b3a6cbb5bc56c1ed658218a21aa1a864fcde0ce24eb07ae7735b4a327dbe833f",
"zh:bd9bfea930e43d47b65ed26254192e19584432227d64588ed280507ae46f2295",
"zh:d8cbc0e13477acf7bd85362a89a25ab377cbef566e7a1ddf4a577eebfd89de19",
"zh:e45d0fa9a895157c4ebc2faa6b7f8252351426bc06c09537a5d9a2a918b76b20",
"zh:f032d90900b00ed5a8d9d990cd382d3427366f1f394ccbd681a372f436a45b7c",
"zh:f54b2cfc0f26c2ad44b0eba1383642c1c27a5f1a3b1c167115196c818c3b94dd",
]
}
@@ -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 @@
[![Build Status](https://travis-ci.com/Telmate/terraform-provider-proxmox.svg?branch=master)](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)
+3
View File
@@ -0,0 +1,3 @@
# Terraform Proxmox
You can add an additional description here.
@@ -0,0 +1,3 @@
proxmox_api_url = "https://192.168.2.2:8006/api2/json" # Your Proxmox IP Address
proxmox_api_token_id = "root@pam!terraform" # API Token ID
proxmox_api_token_secret = "8a1f9308-cc3b-498b-ae2d-274313a17592"
+7
View File
@@ -0,0 +1,7 @@
services:
terraform:
image: hashicorp/terraform
volumes:
- .:/terraform
working_dir: /terraform
network_mode: host
+58
View File
@@ -0,0 +1,58 @@
# Proxmox Full-Clone
# ---
# Create a new VM from a clone
resource "proxmox_vm_qemu" "ubuntu-2504-003" {
# VM General Settings
target_node = "pve"
vmid = "100"
name = "ubuntu-2504-003"
desc = "Test Server"
# VM Advanced General Settings
onboot = true
# VM OS Settings
clone = "ubuntu-2504-template"
# VM System Settings
agent = 0
# VM CPU Settings
cores = 1
sockets = 1
#cpu = "x86-64-v2-AES"
# VM Hard Drive Setting
scsihw = "virtio-scsi-single"
disks {
scsi {
scsi0 {
disk {
size = "100G"
storage = "Data"
format = "qcow2"
}
}
}
}
# VM Memory Settings
memory = 1024
# VM Cloud-Init Settings
os_type = "cloud-init"
# (Optional) IP Address and Gateway
ipconfig0 = "ip=192.168.2.99/22,gw=192.168.0.1"
# (Optional) Default User
# ciuser = "your-username"
# (Optional) Add your SSH KEY
# sshkeys = <<EOF
# #YOUR-PUBLIC-SSH-KEY
# EOF
}
+36
View File
@@ -0,0 +1,36 @@
# Proxmox Provider
# ---
# Initial Provider Configuration for Proxmox
terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = "3.0.1-rc9"
}
}
}
variable "proxmox_api_url" {
type = string
}
variable "proxmox_api_token_id" {
type = string
}
variable "proxmox_api_token_secret" {
type = string
}
provider "proxmox" {
pm_api_url = var.proxmox_api_url
pm_api_token_id = var.proxmox_api_token_id
pm_api_token_secret = var.proxmox_api_token_secret
# (Optional) Skip TLS Verification
pm_tls_insecure = true
}
+146
View File
@@ -0,0 +1,146 @@
{
"version": 4,
"terraform_version": "1.12.1",
"serial": 1,
"lineage": "ba312982-a404-7a77-e37f-5af5e21d18cb",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "proxmox_vm_qemu",
"name": "ubuntu-2504-003",
"provider": "provider[\"registry.terraform.io/telmate/proxmox\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"additional_wait": 5,
"agent": 0,
"agent_timeout": 90,
"args": "",
"automatic_reboot": true,
"balloon": 0,
"bios": "seabios",
"boot": "order=scsi0",
"bootdisk": "",
"ci_wait": null,
"cicustom": null,
"cipassword": "",
"ciupgrade": false,
"ciuser": "",
"clone": "ubuntu-2504-template",
"clone_id": null,
"clone_wait": 10,
"cores": 1,
"cpu": [],
"cpu_type": "host",
"current_node": "pve",
"default_ipv4_address": "",
"default_ipv6_address": "",
"define_connection_info": true,
"desc": "Test Server",
"disk": [],
"disks": [],
"efidisk": [],
"force_create": false,
"force_recreate_on_change_of": null,
"full_clone": true,
"hagroup": "",
"hastate": "",
"hostpci": [],
"hotplug": "network,disk,usb",
"id": "pve/qemu/100",
"ipconfig0": "ip=192.168.2.99/22,gw=192.168.0.1",
"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": 1024,
"name": "ubuntu-2504-003",
"nameserver": null,
"network": [],
"numa": false,
"onboot": true,
"os_network_config": null,
"os_type": "cloud-init",
"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": "1f071dda-115d-4e8a-9a71-cc7b0b60e709",
"version": ""
}
],
"sockets": 1,
"ssh_forward_ip": null,
"ssh_host": "",
"ssh_port": "22",
"ssh_private_key": null,
"ssh_user": null,
"sshkeys": null,
"startup": "",
"tablet": true,
"tags": "",
"target_node": "pve",
"target_nodes": null,
"timeouts": null,
"tpm_state": [],
"unused_disk": [],
"usb": [],
"usbs": [],
"vcpus": null,
"vga": [],
"vm_state": "running",
"vmid": 100
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "cipassword"
}
],
[
{
"type": "get_attr",
"value": "ssh_private_key"
}
]
],
"identity_schema_version": 0,
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWZhdWx0IjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19"
}
]
}
],
"check_results": null
}