PoC OpenTofu configuration works
This commit is contained in:
48
template.tf
Normal file
48
template.tf
Normal file
@@ -0,0 +1,48 @@
|
||||
resource "proxmox_virtual_environment_vm" "ubuntu_template" {
|
||||
name = "ubuntu-template"
|
||||
node_name = var.virtual_environment_node_name
|
||||
|
||||
template = true
|
||||
started = false
|
||||
|
||||
machine = "q35"
|
||||
bios = "ovmf"
|
||||
description = "Managed by OpenTofu"
|
||||
|
||||
cpu {
|
||||
cores = 2
|
||||
}
|
||||
|
||||
memory {
|
||||
dedicated = 2048
|
||||
}
|
||||
|
||||
efi_disk {
|
||||
datastore_id = var.datastore_id
|
||||
type = "4m"
|
||||
}
|
||||
|
||||
disk {
|
||||
datastore_id = var.datastore_id
|
||||
file_id = "local:iso/jammy-server-cloudimg-amd64.img"
|
||||
interface = "virtio0"
|
||||
iothread = true
|
||||
discard = "on"
|
||||
size = 20
|
||||
}
|
||||
|
||||
initialization {
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = "dhcp"
|
||||
}
|
||||
}
|
||||
|
||||
user_data_file_id = proxmox_virtual_environment_file.user_data_cloud_config.id
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = "vmbr0"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user