Added opentofu

This commit is contained in:
2024-01-14 13:43:08 +01:00
parent 562a8e2e93
commit 12671ceabb
11 changed files with 287 additions and 17 deletions

View File

@@ -0,0 +1,75 @@
# proxmox_virtual_environment_vm.devops:
resource "proxmox_virtual_environment_vm" "k3s" {
vm_id = "202"
name = "k3s"
node_name = "proxmox"
acpi = false
clone {
vm_id = 9999
}
initialization {
datastore_id = "local"
interface = "ide2"
user_account {
keys = var.virtual_environment_sshkeys
username = "tim"
password = random_password.k3s_vm_password.result
}
ip_config {
ipv4 {
address = "dhcp"
}
ipv6 {
address = "auto"
}
}
}
disk {
datastore_id = "local"
interface = "scsi0"
size = 50
discard = "on"
ssd = true
iothread = true
}
cpu {
cores = 2
flags = []
hotplugged = 0
numa = false
sockets = 1
type = "host"
}
memory {
dedicated = 4096
floating = 0
shared = 0
}
network_device {
bridge = "vmbr0"
enabled = true
firewall = false
model = "virtio"
mtu = 0
rate_limit = 0
vlan_id = 0
}
}
resource "random_password" "k3s_vm_password" {
length = 16
override_special = "_%@"
special = true
}
output "k3s_packer_vm_password" {
value = random_password.k3s_vm_password.result
sensitive = true
}