108 lines
1.8 KiB
HCL
108 lines
1.8 KiB
HCL
resource "null_resource" "cloud_init_deb" {
|
|
connection {
|
|
type = "ssh"
|
|
user = "root"
|
|
private_key = file("~/.ssh/pve2.comprofix.xyz")
|
|
host = "pve2.comprofix.xyz"
|
|
agent = true
|
|
}
|
|
|
|
provisioner "file" {
|
|
source = "files/cloud_init.cloud_config"
|
|
destination = "/var/lib/vz/snippets/cloud_init_deb.yml"
|
|
}
|
|
}
|
|
|
|
|
|
resource "proxmox_vm_qemu" "docker" {
|
|
|
|
# VM General Settings
|
|
target_node = "pve"
|
|
vmid = "101"
|
|
name = "docker"
|
|
desc = "Docker Server"
|
|
|
|
|
|
# VM Advanced General Settings
|
|
onboot = true
|
|
scsihw = "virtio-scsi-single"
|
|
|
|
# VM OS Settings
|
|
clone = "debian-12-generic-amd64"
|
|
clone_wait = 120
|
|
timeouts {
|
|
create = "1h"
|
|
delete = "1h"
|
|
}
|
|
|
|
# VM System Settings
|
|
agent = 1
|
|
machine = "q35"
|
|
qemu_os = "l26"
|
|
|
|
# VM CPU Settings
|
|
cores = 4
|
|
sockets = 1
|
|
cpu = "x86-64-v2-AES"
|
|
bios = "ovmf"
|
|
|
|
startup = "order=2,up=600"
|
|
|
|
|
|
# VM Memory Settings
|
|
memory = 16384
|
|
|
|
# VM Network Settings
|
|
network {
|
|
bridge = "vmbr0"
|
|
model = "virtio"
|
|
tag = "10"
|
|
}
|
|
|
|
efidisk {
|
|
efitype = "4m"
|
|
storage = "local-zfs"
|
|
}
|
|
|
|
disks {
|
|
ide {
|
|
ide2 {
|
|
cdrom {
|
|
passthrough = false
|
|
}
|
|
}
|
|
ide3 {
|
|
cloudinit {
|
|
storage = "local-zfs"
|
|
}
|
|
}
|
|
}
|
|
scsi {
|
|
scsi0 {
|
|
disk {
|
|
size = 20
|
|
storage = "local-zfs"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
# VM Cloud-Init Settings
|
|
os_type = "cloud-init"
|
|
#cicustom = "vendor=local:snippets/cloud_init_deb.yml"
|
|
|
|
# (Optional) IP Address and Gateway
|
|
ipconfig0 = "ip=10.10.10.5/24,gw=10.10.10.1"
|
|
nameserver = "10.10.10.1"
|
|
|
|
# (Optional) Default User
|
|
ciuser = var.ci_user # Updated
|
|
cipassword = var.ci_password # Updated
|
|
|
|
# (Optional) Add your SSH Public KEY
|
|
sshkeys = <<EOF
|
|
${var.ssh_key}
|
|
EOF
|
|
|
|
}
|