82 lines
1.1 KiB
HCL
82 lines
1.1 KiB
HCL
terraform {
|
|
required_providers {
|
|
proxmox = {
|
|
source = "bpg/proxmox"
|
|
version = ">= 0.50.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
provider "proxmox" {
|
|
endpoint = "https://192.168.0.166:8006"
|
|
api_token = var.proxmox_api_token
|
|
insecure = true
|
|
}
|
|
|
|
|
|
resource "proxmox_virtual_environment_container" "example_template" {
|
|
description = "Managed by Terraform"
|
|
|
|
start_on_boot = "true"
|
|
|
|
cpu {
|
|
cores = 4
|
|
}
|
|
|
|
memory {
|
|
dedicated = 8192
|
|
swap = 1024
|
|
}
|
|
|
|
disk {
|
|
datastore_id = "local-lvm"
|
|
size = 75
|
|
}
|
|
|
|
console {
|
|
enabled = true
|
|
type = "shell"
|
|
}
|
|
|
|
initialization {
|
|
dns {
|
|
servers = ["192.168.0.181"]
|
|
domain = "local"
|
|
}
|
|
|
|
hostname = "minecraft"
|
|
|
|
ip_config {
|
|
ipv4 {
|
|
address = "dhcp"
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
network_interface {
|
|
name = "eth0"
|
|
firewall = true
|
|
}
|
|
|
|
node_name = "homestrg1"
|
|
|
|
operating_system {
|
|
template_file_id = "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
|
|
type = "ubuntu"
|
|
}
|
|
|
|
|
|
// use auto-generated vm_id
|
|
|
|
tags = [
|
|
"container",
|
|
"ubuntu",
|
|
"terraform",
|
|
]
|
|
|
|
startup {
|
|
order = "3"
|
|
}
|
|
} |