Skip to content

Instantly share code, notes, and snippets.

@IanMulvany
Created September 30, 2013 15:06
Show Gist options
  • Save IanMulvany/6765141 to your computer and use it in GitHub Desktop.
Save IanMulvany/6765141 to your computer and use it in GitHub Desktop.
{
"variables": {
"ssh_name": "vagrant",
"ssh_pass": "vagrant",
"hostname": "packer-test"
},
"builders": [{
"type": "virtualbox",
"guest_os_type": "Ubuntu_64",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--vram", "32"]
],
"disk_size" : 10000,
"iso_url": "/Users/ian/Dropbox/code/private-code/packer-test/ubuntu-12.04.3-server-amd64.iso",
"iso_checksum": "2cbe868812a871242cdcdd8f2fd6feb9",
"iso_checksum_type": "md5",
"http_directory" : "ubuntu_64",
"http_port_min" : 9001,
"http_port_max" : 9001,
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_wait_timeout": "20m",
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"boot_command" : [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://cdn.elifesciences.org/vm/preseed-example.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{user `hostname`}} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
]
}],
"provisioners": [
{
"type": "shell",
"execute_command": "{{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"sleep 30",
"apt-get -y update",
"apt-get -y install vim",
"apt-get -y install curl"
]}
],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": true
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment