80 lines
2.6 KiB
HCL
80 lines
2.6 KiB
HCL
variable "proxmox_apiuser" {
|
|
type = string
|
|
default = "packer"
|
|
}
|
|
|
|
variable "proxmox_apitoken" {
|
|
type = string
|
|
default = "changeme"
|
|
}
|
|
|
|
source "proxmox-iso" "freebsd-15" {
|
|
template_name = "freebsd-15"
|
|
template_description = "FreeBSD 15.1, generated on ${timestamp()}"
|
|
vm_id = "210"
|
|
boot_wait = "5s"
|
|
boot_key_interval = "200ms"
|
|
boot_command = ["2<wait10s>", # boot to single-user mode
|
|
"<enter><wait2s>", # open a shell - default is /bin/sh
|
|
"mdmfs -s 100m md /tmp<enter><wait2s>", # mount a writable /tmp memory disk
|
|
"mdmfs -s 100m md /var/db<enter><wait2s>", # mount a writable /var memory disk
|
|
"dhclient vtnet0<enter><wait5>", # bring up network
|
|
"fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-15-installerconfig<enter><wait5s>", # grab the installerconfig
|
|
"bsdinstall script /tmp/installerconfig<enter>" # execute bsdinstall with fetched config
|
|
]
|
|
|
|
http_directory = "http"
|
|
http_port_max = "8089"
|
|
http_port_min = "8080"
|
|
|
|
os = "other"
|
|
cores = "2"
|
|
sockets = "1"
|
|
cpu_type = "host"
|
|
memory = "2048"
|
|
scsi_controller = "virtio-scsi-single"
|
|
disks {
|
|
disk_size = "30G"
|
|
storage_pool = "templates"
|
|
type = "scsi"
|
|
format = "qcow2"
|
|
}
|
|
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}"
|
|
node = "kamino"
|
|
pool = "Templates"
|
|
|
|
boot_iso {
|
|
type = "scsi"
|
|
iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/15.1/FreeBSD-15.1-RELEASE-amd64-bootonly.iso"
|
|
iso_checksum = "sha256:3e74120a59512cefc35840443bdd05087c8a010a27cf8a6fbb4f7450824f092e"
|
|
iso_download_pve = true
|
|
iso_storage_pool = "iso"
|
|
unmount = true
|
|
}
|
|
|
|
ssh_username = "xadmin"
|
|
ssh_password = "packer"
|
|
ssh_timeout = "20m"
|
|
}
|
|
|
|
build {
|
|
sources = ["source.proxmox-iso.freebsd-15"]
|
|
|
|
provisioner "shell" {
|
|
script = "scripts/freebsd-install.sh"
|
|
}
|
|
|
|
provisioner "file" {
|
|
source = "scripts/initial-setup.sh"
|
|
destination = "/home/xadmin/initial-setup.sh"
|
|
}
|
|
}
|