Skip to content

Instantly share code, notes, and snippets.

@arl
Created February 23, 2018 10:52
Show Gist options
  • Save arl/ad3d1483aefb534d678c180a56052e48 to your computer and use it in GitHub Desktop.
Save arl/ad3d1483aefb534d678c180a56052e48 to your computer and use it in GitHub Desktop.
packer config ubuntu-1604-base
{
"builders": [{
"name": "ubuntu-1604-server",
"vm_name": "ubuntu-1604-server",
"type": "vmware-iso",
"guest_os_type": "ubuntu-64",
"tools_upload_flavor": "linux",
"headless": true,
"iso_url": "file://./isos/ubuntu-16.04.3-server-amd64.iso",
"iso_checksum": "bba314624956961a2ea31dd460cd860a77911c1e0a56e4820a12b9c5dad363f5",
"iso_checksum_type": "sha256",
"ssh_username": "nullgrid",
"ssh_password": "nullgrid",
"ssh_timeout": "15m",
"disk_type_id": "thin",
"floppy_files": [
"preseed/ubuntu.cfg"
],
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz noapic ",
"preseed/file=/floppy/ubuntu.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"grub-installer/bootdev=/dev/sda ",
"initrd=/install/initrd.gz -- <enter>"
],
"shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'nullgrid'|sudo -S sh 'shutdown.sh'",
"remote_type": "esx5",
"remote_host": "{{user `esxi_host`}}",
"remote_datastore": "{{user `esxi_datastore`}}",
"remote_username": "{{user `esxi_username`}}",
"remote_password": "{{user `esxi_password`}}",
"keep_registered": true
}],
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/open-vm-tools.sh"
],
"execute_command": "echo 'nullgrid' | {{ .Vars }} sudo -E -S bash '{{ .Path }}'"
}
],
"variables": {
"vnc_port_min": "5901",
"vnc_port_max": "5901",
"vnc_disable_password": "true"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment