Skip to content

Instantly share code, notes, and snippets.

@cwebberOps
Created June 30, 2013 03:46
Show Gist options
  • Save cwebberOps/5893767 to your computer and use it in GitHub Desktop.
Save cwebberOps/5893767 to your computer and use it in GitHub Desktop.
packer template
{
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/postinstall.sh"
],
"override": {
"virtualbox": {
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'"
},
"vmware": {
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'"
}
}
}
],
"builders": [
{
"type": "virtualbox",
"boot_command": [
"linux text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks-vbox.cfg<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 80140,
"guest_os_type": "RedHat_64",
"http_directory": "http",
"iso_md5": "445cfe6236327450bcbda17319b73559",
"iso_url": "http://mirrors.arsc.edu/centos/5.9/isos/x86_64/CentOS-5.9-x86_64-netinstall.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
"guest_additions_path": "VBoxGuestAdditions.iso",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"384"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
],
[
"modifyvm",
"{{.Name}}",
"--ioapic",
"on"
],
[
"modifyvm",
"{{.Name}}",
"--pae",
"on"
]
]
},
{
"type": "vmware",
"boot_command": [
"linux text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 80140,
"guest_os_type": "centos-64",
"http_directory": "http",
"iso_md5": "445cfe6236327450bcbda17319b73559",
"iso_url": "http://mirrors.arsc.edu/centos/5.9/isos/x86_64/CentOS-5.9-x86_64-netinstall.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
"vmx_data": {
"memsize": "384",
"numvcpus": "1",
"cpuid.coresPerSocket": "1"
}
}
],
"post-processors": ["vagrant"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment