Skip to content

Instantly share code, notes, and snippets.

@skonto
Created May 10, 2016 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skonto/14430bf86ce4ab10851f159c7c0fe1e3 to your computer and use it in GitHub Desktop.
Save skonto/14430bf86ce4ab10851f159c7c0fe1e3 to your computer and use it in GitHub Desktop.
my packer tempalte
{
"builders": [
{
"type": "virtualbox-iso",
"name": "mybox",
"guest_os_type": "Ubuntu_64",
"iso_url": "file:///home/stavros/Downloads/ubuntu-16.04-server-amd64.iso",
"iso_checksum": "23e97cd5d4145d4105fbf29878534049",
"iso_checksum_type": "md5",
"ssh_username": "user",
"ssh_password": "user",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"boot_wait": "10s",
"guest_additions_mode": "upload",
"guest_additions_path" : "VBoxGuestAdditions_{{.Version}}.iso",
"headless": false,
"http_directory" : "cfg",
"boot_command" : [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic auto=true preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
"hostname={{ .Name }} <wait>",
"fb=false debconf/frontend=noninteractive <wait>",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
"initrd=/install/initrd.gz -- <enter><wait>"
],
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"4"
],
[
"modifyvm",
"{{.Name}}",
"--vram",
"64"
]
]
}
],
"provisioners": [
{
"type": "shell",
"script": "install.sh",
"execute_command": "echo 'user' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'"
}
]
}
@skonto
Copy link
Author

skonto commented May 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment