init: add initial code
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "bpg/proxmox"
|
||||
version = "~> 0.78.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_vm" "this" {
|
||||
name = var.vm_name
|
||||
node_name = var.node_name
|
||||
vm_id = var.vm_id
|
||||
|
||||
clone {
|
||||
vm_id = var.template_id
|
||||
}
|
||||
|
||||
agent {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
cpu {
|
||||
cores = var.cpu_cores
|
||||
type = "x86-64-v2-AES"
|
||||
}
|
||||
|
||||
memory {
|
||||
dedicated = var.memory_mb
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = var.bridge
|
||||
}
|
||||
|
||||
initialization {
|
||||
hostname = var.vm_name
|
||||
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = var.ip_address
|
||||
gateway = var.gateway
|
||||
}
|
||||
}
|
||||
|
||||
user_account {
|
||||
username = "debian"
|
||||
keys = [var.ssh_public_key]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user