Skip to content

Instantly share code, notes, and snippets.

@NathanDotTo
Created April 7, 2016 15:06
Show Gist options
  • Save NathanDotTo/d9b3f59f694801926a339300a8c8e982 to your computer and use it in GitHub Desktop.
Save NathanDotTo/d9b3f59f694801926a339300a8c8e982 to your computer and use it in GitHub Desktop.
{
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/setup.sh"
},
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/ansible.sh"
},
{
"type": "ansible-local",
"playbook_file": "ansible/main.yml",
"role_paths": [
"/etc/ansible/roles/geerlingguy.packer-debian",
"/etc/ansible/roles/geerlingguy.nfs"
]
},
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/cleanup.sh"
}
],
"builders": [
{
"type": "vmware-iso",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz",
" auto=true",
" priority=critical",
" initrd=/install/initrd.gz",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
" -- ",
"<enter>"
],
"boot_wait": "10s",
"disk_size": 81920,
"guest_os_type": "ubuntu-64",
"headless": true,
"http_directory": "http",
"iso_urls": [
"iso/ubuntu-14.04.4-server-amd64.iso",
"http://releases.ubuntu.com/14.04/ubuntu-14.04.4-server-amd64.iso"
],
"iso_checksum_type": "md5",
"iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a",
"output_directory": "packer-ubuntu-14.04-amd64-vmware",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"tools_upload_flavor": "linux",
"vm_name": "packer-ubuntu-14.04-amd64-test2",
"vmx_data": {
"cpuid.coresPerSocket": "1",
"memsize": "512",
"numvcpus": "2"
}
}
],
"post-processors": [
{
"output": "builds/{{.Provider}}-ubuntu1404.box",
"type": "vagrant"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment