2024-04-19 14:00:34 -04:00
|
|
|
variable "proxmox_apiuser" {
|
|
|
|
type = string
|
|
|
|
default = "packer"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "proxmox_apitoken" {
|
|
|
|
type = string
|
|
|
|
default = "changeme"
|
|
|
|
}
|
|
|
|
|
|
|
|
source "proxmox-iso" "ubuntu-22" {
|
|
|
|
template_name = "ubuntu-22"
|
2024-04-21 01:54:33 -04:00
|
|
|
template_description = "Ubuntu 22.04, generated on ${timestamp()}"
|
|
|
|
vm_id = "205"
|
2024-04-19 14:00:34 -04:00
|
|
|
boot_wait = "10s"
|
|
|
|
boot_key_interval = "200ms"
|
|
|
|
boot_command = [
|
2024-04-19 17:45:49 -04:00
|
|
|
# Edit boot options
|
|
|
|
"e<wait>",
|
2024-04-19 14:00:34 -04:00
|
|
|
|
2024-04-19 17:45:49 -04:00
|
|
|
# Go to the end of the boot command
|
2024-04-20 22:05:11 -04:00
|
|
|
"<down><down><down><down><left> <wait>",
|
2024-04-19 14:00:34 -04:00
|
|
|
|
2024-04-21 12:59:29 -04:00
|
|
|
# Add kernel command-line to start autoinstall
|
2024-04-19 14:00:34 -04:00
|
|
|
"autoinstall ",
|
2024-04-20 22:05:11 -04:00
|
|
|
"ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-22/\"",
|
|
|
|
"<leftCtrlOn>x<leftCtrlOff><wait>"
|
2024-04-19 14:00:34 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
http_directory = "http"
|
|
|
|
http_port_max = "8089"
|
|
|
|
http_port_min = "8080"
|
|
|
|
|
|
|
|
os = "l26"
|
|
|
|
cores = "2"
|
|
|
|
sockets = "1"
|
2024-04-20 22:05:11 -04:00
|
|
|
cpu_type = "host"
|
2024-04-19 14:00:34 -04:00
|
|
|
memory = "2048"
|
2024-04-20 22:05:11 -04:00
|
|
|
scsi_controller = "virtio-scsi-single"
|
2024-04-19 14:00:34 -04:00
|
|
|
disks {
|
|
|
|
disk_size = "30G"
|
|
|
|
storage_pool = "templates"
|
|
|
|
type = "scsi"
|
|
|
|
}
|
|
|
|
network_adapters {
|
|
|
|
bridge = "vmbr0"
|
|
|
|
model = "virtio"
|
|
|
|
}
|
|
|
|
|
|
|
|
proxmox_url = "https://kamino.int.metaunix.net:8006/api2/json/"
|
|
|
|
insecure_skip_tls_verify = true
|
|
|
|
username = "${var.proxmox_apiuser}"
|
|
|
|
password = "${var.proxmox_apitoken}"
|
2024-04-21 01:55:46 -04:00
|
|
|
node = "kamino"
|
2024-04-21 01:54:33 -04:00
|
|
|
pool = "Templates"
|
2024-04-19 14:00:34 -04:00
|
|
|
|
|
|
|
iso_url = "https://releases.ubuntu.com/22.04.4/ubuntu-22.04.4-live-server-amd64.iso"
|
2024-04-19 17:45:49 -04:00
|
|
|
iso_checksum = "sha256:45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2"
|
2024-04-19 14:00:34 -04:00
|
|
|
iso_storage_pool = "iso"
|
|
|
|
unmount_iso = true
|
|
|
|
iso_download_pve = true
|
|
|
|
|
|
|
|
ssh_username = "xadmin"
|
|
|
|
ssh_password = "packer"
|
|
|
|
ssh_timeout = "20m"
|
|
|
|
}
|
|
|
|
|
|
|
|
build {
|
|
|
|
sources = ["source.proxmox-iso.ubuntu-22"]
|
2024-04-21 01:54:33 -04:00
|
|
|
|
|
|
|
provisioner "shell" {
|
2024-04-21 12:32:29 -04:00
|
|
|
scripts = [
|
|
|
|
"scripts/debian-install.sh",
|
|
|
|
"scripts/remove-snap.sh"
|
|
|
|
]
|
2024-04-21 01:54:33 -04:00
|
|
|
}
|
2024-04-19 14:00:34 -04:00
|
|
|
}
|