2024-04-18 00:42:00 -04:00
|
|
|
variable "proxmox_apiuser" {
|
|
|
|
type = string
|
|
|
|
default = "packer"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "proxmox_apitoken" {
|
|
|
|
type = string
|
|
|
|
default = "changeme"
|
|
|
|
}
|
|
|
|
|
|
|
|
source "proxmox-iso" "freebsd-14" {
|
|
|
|
template_name = "freebsd-14"
|
2024-10-08 23:54:28 -04:00
|
|
|
template_description = "FreeBSD 14.1, generated on ${timestamp()}"
|
2024-04-21 01:54:33 -04:00
|
|
|
vm_id = "202"
|
2024-04-18 15:22:10 -04:00
|
|
|
boot_wait = "10s"
|
2024-04-18 11:40:59 -04:00
|
|
|
boot_key_interval = "200ms"
|
2024-10-08 23:54:28 -04:00
|
|
|
boot_command = ["<enter>", "<wait15s>", "<enter><wait1s>", "<enter><wait1s>", "freebsd", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait5s>", "<right><enter><wait1s>", "<enter><wait1s>", "<enter><wait4s>", "<enter><wait1s>", "<enter><wait1s>", " <enter><wait1s>", "<left><enter><wait1s>", "<enter><wait80s>", "packer<enter><wait1s>", "packer<enter><wait1s>", "<down><down><enter><wait1s>", "95<up><enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<down><down><down> <enter><wait1s>", "<down><down><down><down><down><down><down><down> <enter><wait1s>", "<enter><wait1s>", "xadmin<enter>", "Remote admin user<enter>", "<enter>", "<enter>", "wheel<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "packer<enter>", "packer<enter>", "<enter>", "<enter>", "<enter><wait1s>", "<enter><wait1s>", "<left><enter><wait1s>", "pkg update && pkg install -y bash sudo qemu-guest-agent<enter><wait3s>", "y<enter><wait40s>", "echo 'xadmin ALL=(ALL:ALL) NOPASSWD:ALL' > /usr/local/etc/sudoers.d/xadmin<enter><wait1s>", "echo 'qemu_guest_agent_enable=\"YES\"' >> /etc/rc.conf<enter><wait1s>", "exit<enter><wait1s>", "<enter><wait40s>"]
|
2024-04-18 11:34:46 -04:00
|
|
|
|
2024-04-18 11:37:20 -04:00
|
|
|
os = "other"
|
|
|
|
cores = "2"
|
|
|
|
sockets = "1"
|
2024-04-20 22:05:11 -04:00
|
|
|
cpu_type = "host"
|
2024-04-18 11:34:46 -04:00
|
|
|
memory = "2048"
|
2024-04-20 22:05:11 -04:00
|
|
|
scsi_controller = "virtio-scsi-single"
|
2024-04-18 00:42:00 -04:00
|
|
|
disks {
|
2024-04-20 22:05:11 -04:00
|
|
|
disk_size = "30G"
|
2024-04-18 00:42:00 -04:00
|
|
|
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-18 00:42:00 -04:00
|
|
|
|
2024-10-08 23:54:28 -04:00
|
|
|
iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.1/FreeBSD-14.1-RELEASE-amd64-bootonly.iso"
|
|
|
|
iso_checksum = "sha256:e40f99eaef691b1545149e242d0ca3808bfcd9711a08bd11e2cb5e62d290c884"
|
2024-04-18 00:42:00 -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.freebsd-14"]
|
2024-04-21 01:54:33 -04:00
|
|
|
|
|
|
|
provisioner "shell" {
|
2024-04-21 12:30:20 -04:00
|
|
|
script = "scripts/freebsd-install.sh"
|
2024-04-21 01:54:33 -04:00
|
|
|
}
|
2024-04-23 10:54:08 -04:00
|
|
|
|
|
|
|
provisioner "file" {
|
|
|
|
source = "scripts/initial-setup.sh"
|
|
|
|
destination = "/home/xadmin/initial-setup.sh"
|
|
|
|
}
|
2024-04-18 00:42:00 -04:00
|
|
|
}
|